This is not an issue since both methods work everywhere I've tested them, but I'm just wondering which method is better (more efficient, more compatible, etc) to use for creating a new element with js. Or, if one is the official/standard/preferred method, which it is.
eg: in my js powered slideshow, I create required elements with js so that it won't show up on browsers where it won't work. I could write:
document.write('<div id="r1"></div>');
var r1 = document.getElementById('r1');
or...
var r1 = document.createElement('div');
document.body.appendChild(r1);
Thanks for reading.