How to add class to dynamically generated text box in DOM?
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";
精彩评论