How to get value from td hidden field through jquery
<p>I have a dynamic table. I am trying to get a value of a hidden field which is <code>order_id</code>, but I am getting only the first <code>id</code>. If I click on the 3rd or 4th etc button I still get the <code>order_id</code> of the first td. Below is my code :</p>

<pre><code>&lt;tr&gt;
    &lt;td&gt;id&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
    &lt;td&gt;
        &lt;input type="hidden" id="hid" value="&lt;?php echo $id; ?&gt;"&gt;
        &lt;input type="button" id="sends" value="Send" onclick="sendemails();"&gt;
    &lt;/td&gt;
&lt;/tr&gt;

&lt;script&gt;
    function sendemails(){
        var sends = $('#sends').val();
        var hid = $('#hid').val();
        alert(hid);
    }
&lt;/script&gt;
</code></pre>