Reputation: 301
Consider the following code:
document.write("a<b");
When I try to run that, it makes a outputs displaying the letter a
. I think this is because it thinks that I want to start a tag, therefor excluding the rest. Is there a way to bypass this? A way to still display the <
, and the rest of the line, too? It seems that the escape character, \
, does not work (or am I doing something wrong?)
Thanks
Upvotes: 0
Views: 23
Reputation: 21575
Yes it does think you are writing a tag for document.write()
, instead use <
, as in less-than:
document.write("a<b");
Upvotes: 2