title: How can I pass the row id from a table with a button
body: <p>I have a table I want to add a button to each row and edit the row in a form. I need to pass the LineNumber into my getjson request. how can I do that? Here is my table and my getjson. (edit)I just noticed I'm asking for LineNumber but what I really want is the id of the button pushed '+value.linenumber+'.</p>
  
  <pre><code>//table goes though a loop.
  table_obj.append($('&lt;tr&gt;&lt;td&gt;'+value.SLN+'&lt;/td&gt;&lt;td  &gt;'+value.Type+'&lt;/td&gt;&lt;td     &gt;
  '+value.StopNumber+'&lt;/td&gt;&lt;td&gt;'+value.LoName+'&lt;/td&gt;&lt;td &gt;'+value.ReferenceNo+'&lt;/td&gt;
  &lt;td class="hide" &gt;'+value.TypeId+'&lt;/td&gt;&lt;td class="hide" &gt;'+value.LocationId+'&lt;/td&gt;
  &lt;td class="hide" &gt;'+value.lineNumber+'&lt;/td&gt;&lt;td&gt;&lt;button id='+value.lineNumber+'
  onclick=edit()&gt;Edit&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;'));
  
  //getjson
  &lt;script&gt; function edit()
  $.getJSON("editstops.php",{ LineNumber:$('#LineNumber').val() },stophandler)
  var stophandler = function(data){
  $("#SLNS").val(data[0].value.LoadNumber);
  $("#Type").val(data[0].value.Type);
      $("#StopNumber").val(data[0].value.StopNumber);
  $("#LoName").val(data[0].value.LoName);
  $("#ReferenceNo").val(data[0].value.ReferenceNo);   
  $("#TypeId").val(data[0].value.TypeId);
  $("#LocationId").val(data[0].value.LocationId);
      $("#LineNumber").val(data[0].value.Linenumber);
  };
  
  &lt;/script&gt;
  </code></pre>