 <p>Simple: It does nothing. It doesn't escape anything.<br> Entering \n in a textbox enters two characters. This is different from defining <code>var s = "\n"</code> as this is only one character.</p>