Reputation: 536
How do I write a <br/>
tag in JavaScript?
Upvotes: 13
Views: 125011
Reputation: 943214
var mybr = document.createElement('br');
someElement.appendChild(mybr);
Further reading:
Upvotes: 21
Reputation: 1
Use the operator + in the document.write(var1 + "text" + and the break tag);
Upvotes: -2
Reputation: 218828
document.write('<br />');
Or, since no Stack Overflow question on JavaScript would be complete without jQuery...
http://www.thenerdary.net/post/20965430596/beautiful-element-creation-with-jquery
Upvotes: 1