How to md5 jQuery variable?
<p>I need to <code>md5</code> a password before sending it via post</p>
<pre><code>&lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js&quot;&gt;&lt;/script&gt;

&lt;input type=&quot;text&quot; name=&quot;password&quot; id=&quot;password&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;submit&quot; onclick=&quot;encrpt()&quot;&gt;

&lt;script&gt;
function encrpt(){
    var password = $(&quot;#password&quot;).val();
$(&quot;#password&quot;).val(&quot;&lt;?php echo md5(1234); ?&gt;&quot;);
    }
&lt;/script&gt;
</code></pre>
<p>This code works fine and <code>md5</code> value of 12345 set into password field but whenever I use jQuery password value it gives wrong value like</p>
<pre><code>$(&quot;#password&quot;).val(&quot;&lt;?php echo md5('&lt;script&gt;password&lt;/script&gt;'); ?&gt;&quot;);
</code></pre>
<p>I need to <code>md5</code> value of the password which I entered into field.</p>