+ 1
We can add an element with appEnd() in JQuery But What about JavaScript ?
How can I add a element to end of div in JavaScript ?
6 Réponses
+ 10
element.appendChild( );
+ 10
It appends an element to an another element. :)
Add a class?
element.className = "your_class";
+ 9
txt.className = "..."
txt.name = "..."
Cross Browser solution - https://stackoverflow.com/questions/1362513/can-i-use-javascript-to-set-the-name-attribute
0
I think it is only create a element .How can I add a class to new element 😊
0
txt=document.createElement("textarea");
txtDivi.appendChild(txt);
How can I add a class and name to txt
0
Thank you Maz 😊😊