Convert special characters to HTML in Javascript
<p>Does any one know how to convert special characters to HTML in Javascript?</p>

<p>Example:</p>

<p>'&amp;' (ampersand) becomes '&amp;amp' <br>
 '"' (double quote) becomes '&amp;quot' when ENT_NOQUOTES is not set.<br>
 ''' (single quote) becomes '&amp;#039' only when ENT_QUOTES is set.<br>
 '&lt;' (less than) becomes '&amp;lt'<br>
 '>' (greater than) becomes '&amp;gt'</p>
