Grab value of hidden input and assign to another input's value
<p>I have an hidden input:</p>

<pre><code> &lt;input type="hidden" id="hidden" /&gt; 

 $('#hidden').before('&lt;input type="text" id="mhidden" alt="decimal" value="" /&gt;');
 var val = $('#hidden').val();
 $('#mhidden').val(val);
</code></pre>

<p>In <code>&lt;input type="text" id="mhidden" alt="decimal" value="" /&gt;</code> the value is empty in html but with <code>alert($('#mhidden').val(val));</code> has a value. Why the value of #mhidden is empty? I want to assign hidden input's value to #mhidden.</p>

<p>Thanks in advance</p>
