get value by javascript
<p>i m use php which print my table in which first column is sr.no but in which i want to store value of exam_id.
how can i get this Exam_id value by javascript</p>

<pre><code>        foreach ($data as $key) {
            echo "&lt;tr&gt;";
            print'
&lt;td class="contact" id="exam_id" name=' . $key['exam_id'] ." width="5%" value='.$key['date'].'&gt;' . $i . '&lt;/td&gt;
&lt;td class="contact"  width="20%"&gt;' . $key['date'] . '/' . $key['month'] . '/' . $key['year'] . '&lt;/td&gt;
&lt;td class="contact"  width="30%"&gt;' . $key['Title'] . '&lt;/td&gt;
&lt;td class="contact"  width="20%"&gt;' . $key['Branch'] . '&lt;/td&gt;
&lt;td class="contact"  width="6%"&gt;' . $key['Sem'] . '&lt;/td&gt;
&lt;td class="contact" width="24%" &gt;&lt;a onclick="javascript:create_result();" href="#"&gt;Create Result&lt;/a&gt;&lt;/td&gt;';

            $i++;
            echo "&lt;/tr&gt;";
        }
</code></pre>

<p>javacript is</p>

<pre><code>&lt;script type="text/javascript"&gt;
    function create_result() {

 var exam_id = document.getElementById('exam_id').value



      $.ajax({type:'POST', url: 'result/create_result',data:exam_id, success: function(response) {
              $('#content').html(response);
   }});
    return false;
}
&lt;/script&gt;
</code></pre>
