Why JavaScript converts my < into &gt;
<p>JavaScript converts my <code>&lt;</code> into <code>&amp;gt;</code>. I want to alert it but my message is with encoded marks like <code>@#&amp;amp;*()}{&amp;gt;?&amp;gt;?</code> - how to <strong>display it normally</strong> but <strong>prevent from executing</strong> as HTML code?</p>

<pre><code>&lt;span id="ID" onClick="alertIt(this.id);"&gt;

    &lt;p&gt;Some string with special chars: ~!@#&amp;*()}{&gt;?&gt;?&gt;|{"&gt;@#$#^#$&lt;/p&gt;

    &lt;p&gt;Why when clicked it gives something like this:&lt;/p&gt;

    &lt;p&gt;'&lt;br&gt;
    Some string with special chars: ~!@#&amp;amp;*()}{&amp;gt;?&amp;gt;?&gt;|... and so on
    &lt;br&gt;'&lt;/p&gt;

&lt;/span&gt;

&lt;script type="text/javascript"&gt;

function alertIt(ID)
{

    var ID = ID;
    var content = document.getElementById(ID).innerHTML;

    alert(content);

}

&lt;/script&gt;
</code></pre>
