Convert back to HTML entities from Javascript
<p>Hi there i have following line of code:</p>

<pre><code>$('#chooseCurrencyType').append("&lt;li&gt;"+key+" - &amp;#"+parseInt(data[key], 16)+"&lt;/li&gt;");
</code></pre>

<p>It displays as below in html: <code>USD - $</code></p>

<p>Here  <code>parseInt("0024", 16) = 36</code> and &amp;#36 will display $(dollar) symbol....</p>

<p>So on executing below code... </p>

<pre><code>($('.dropdown-toggle').text())  gives me $..
</code></pre>

<p>But how  to get the value <code>0024</code> from javascript  Or How to convert it back into html entity....</p>

<p>I tried like this:</p>

<pre><code>($('.dropdown-toggle').text()).substring(6,7).charCodeAt(0);  gives me 36 .... 
</code></pre>

<p>So how to convert 36 to 0024  ........ any help please....</p>
