Thursday, September 5, 2013

Add ID/class to objects from createElement method

Add ID/class to objects from createElement method

This w3schools page mentions the HTML DOM createElement() Method. For
example, you can create a button by
var btn=document.createElement("BUTTON");
However, how can I add ID/class to this button? And what else can I do
with it?

No comments:

Post a Comment