chrissecord
07-19-2010, 07:51 PM
Which of these is the correct way to set the className attribute, or are they both okay?
option 1:
var t = document.createElement("p");
t.className = "myclass";
option 2:
var t = document.createElement("p");
t.setAttribute("class","myclass");
option 1:
var t = document.createElement("p");
t.className = "myclass";
option 2:
var t = document.createElement("p");
t.setAttribute("class","myclass");