title: Html Table row id checkbox
body: <p>I would like to have the database table id on each row as checkbox value of a dynamic html table</p>
  
  <p>I am using ajax to fetch data from mysql database and create a new variable as html text to append on tbody of table</p>
  
  <p>Code of HTML</p>
  
  <pre><code>&lt;div class="col-sm-6" id="ftbl"&gt;
      &lt;label for="urbandata"&gt;View urban data&lt;/label&gt;
      &lt;table class="table table-bordered table-striped"&gt;
        &lt;thead&gt;
          &lt;tr&gt;
            &lt;th&gt;Check&lt;/th&gt;
            &lt;th&gt;ID&lt;/th&gt;
            &lt;th&gt;Type&lt;/th&gt;
            &lt;th&gt;Master&lt;/th&gt;
            &lt;th&gt;Slave&lt;/th&gt;
            &lt;th&gt;Orbit&lt;/th&gt;
            &lt;th&gt;Mode&lt;/th&gt;
            &lt;th&gt;Action&lt;/th&gt;
          &lt;/tr&gt;
        &lt;/thead&gt;
        &lt;tbody&gt;
        &lt;/tbody&gt;
      &lt;/table&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Code of JS</p>
  
  <pre class="lang-js prettyprint-override"><code>$.ajax({
      url: "fetchurban.php",
      method: "POST",
      data:{id:id},
      dataType: "JSON",
      success: function(data){
        if (data){
        var trHTML = '';
          $.each(data, function (i, item) {
              trHTML +='&lt;tr&gt;&lt;td&gt;&lt;input type="checkbox" id="checkview" onclick="QuickView()" name="'+ item.TblID +'"&gt;&lt;/td&gt;&lt;td&gt;' + item.Type + '&lt;/td&gt;&lt;td&gt;' + item.Master + '&lt;/td&gt;&lt;td&gt;' + item.Slave + '&lt;/td&gt;&lt;td&gt;' + item.Orbit + '&lt;/td&gt;&lt;td&gt;' + item.Mode + '&lt;/td&gt;&lt;td&gt;&lt;a href='+ item.ImgTIF+ ' title="Download High Quality" data-toggle="tooltip"&gt;&lt;span class="glyphicon glyphicon-download"&gt; &lt;/span&gt;&lt;/a&gt;&lt;a href=#?id='+ item.ImgLow + ' title="Download Low Quality" data-toggle="tooltip"&gt;&lt;span class="glyphicon glyphicon-cloud-download"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;' ;
          });
          $('#ftbl tbody').append(trHTML);
        }
      }
    })
  })
  </code></pre>
  
  <p>If the user select the checkbox I would like to have the id of database table.
  Now with this code I have the same id to all rows of table</p>