Detect the row and get the td value using javascript. (Dynamic table)
<p>I totally want to avoid using inline javascript! But i have a table which is being dynamically generated from a mysql database using php. I want that if a user clicks on any of the rows it creates a modal with the information about the clicked row. Now i am able to initialise the modal, however the first column of the table holds an index value which can be used to retrieve the information about that row. My question is how can i retrieve that index value using javascript. To initiate the modal i am using the following code:</p>

<pre><code>$('#production tr').click(function(){
     $('#review_order').modal('show');
}) ;    
</code></pre>

<p>Table markup:</p>

<pre><code>&lt;table id="order_basket" class="table table-bordered"&gt;
    &lt;thead&gt;
       &lt;th&gt;Voucher ID&lt;/th&gt;
       &lt;th&gt;Title&lt;/th&gt;
       &lt;th&gt;Created By&lt;/th&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
       &lt;tr&gt;&lt;td&gt;1&lt;td&gt;
        &lt;td&gt;Something here&lt;/td&gt;
        &lt;td&gt;Some Person&lt;/td&gt;&lt;/tr&gt;
    &lt;/tbody&gt;
&lt;table&gt;
</code></pre>
