title: How to get the clicked row's id value?
body: <p>I generated a table by getting the values from database.
  I set the primary key value to the row's id value, I have button in that row also.
  How to get the respective id value when I click the button.</p>
  
  <pre><code>  while($pack = mysql_fetch_array($get_pack))
      {
         echo"&lt;tr id='&lt;php echo $pack[id];?&gt;'&gt;";
         echo'&lt;td&gt; &lt;input name="edit_pack" type="button" value="Edit" onclick="javascript:edit_pack()"/&gt;&lt;/td&gt;';
       }
  
  function edit_pack()
     {
     alert("package editing")
     alert(this.id)
     }
  </code></pre>