Which is the more professional way. I like the first one better because you can pass in the class
, id
, name
etc in one line.
1)
var button = "<button type='button' id='mybutton'></button>";
document.body.innerHTML+= button;
2)
var button = document.createElement("BUTTON");
document.body.appendChild(button);