开发者

How to add class to dynamically generated text box in DOM?

开发者 https://www.devze.com 2023-03-16 17:47 出处:网络
I created a textbox using Javascript. How to assign class to text开发者_C百科box in Javascript?Assuming you have a reference to your text-box node, you can just assign a CSS class by setting the cla

I created a textbox using Javascript.

How to assign class to text开发者_C百科box in Javascript?


Assuming you have a reference to your text-box node, you can just assign a CSS class by setting the className property on the node, like:

myTextBox.className = "someClass";
0

精彩评论

暂无评论...
验证码 换一张
取 消