I need to create a <br /> tag dynamically with javascript.
<br />
var br = document.createElement('br');
And
var br = document.createElement('<br />');
doesn't work
The first option urrently creates a <br> tag on the page which doesn't pass XHTML standards, is there anyway around this?
<br>
The first method does not need to pass XHTML standards - you're confusing markup with manipulating the DOM.
1.4m articles
1.4m replys
5 comments
57.0k users