I've noticed an issue I've never encountered before. Strings in JavaScript that contain < are ignored. Why is that? Here are a few of the results I've noticed:
msg = "<This entire string would be ignored."
msg = "This part of the string is ok. <While this part is ignored."
msg = "<This part is ignored> But this half of the string will still print."
Is this some kind of special escape character or something? What is it used for? Additionally, what would be a work around for this?
Here is code:
var msg = "This is my message <This is ignored";
document.write(msg);
innerHTMLof an element with that string, right? Don't do that. You want to set thetextContent.<is used to indicate HTML tags, like<div>,<a>, etc.