I need to create a
tag dynamically with javascript.
var br = document.createElement(\'br\');
And
This question has nothing whatever to do with markup. The argument passed to createElement is an element name, it is not a fragment of markup or anything else, it isn't XML, or HTML, or XHTML, or SGML or any form of markup.
The createElement method returns a DOM object, there is no markup and never was.
Note that the markup passed to the browser is used to create a document object, from that point onward, the markup is irrelevant.