title: how to get a row index in dynamic table via jQuery
body: <p>I use jquery to dynamic create table content in page, how can I get the row number index of this dynamic table? In the following code, when I click the &quot;show more&quot; link, I use index function in following code, but it not work. How to solve this issue? Thanks.</p>
  <pre><code> $.getJSON(JsonURL,
          function(data){
  
              $.each(data, function(index, item){
                  var obj = item;
                  books.push(book);
              });
              for (var i = 0; i&lt;obj.length; i++) {
                  var tr=$('&lt;tr&gt;&lt;/tr&gt;'); 
                  $('&lt;td&gt;'+ obj[i].name +'&lt;/td&gt;').appendTo(tr);
                  $('&lt;td&gt;'+ obj[i].category +'&lt;/td&gt;').appendTo(tr);
                  $('&lt;td&gt;&lt;a class=\'showMore\' href=#&gt;'+ 'show more' +'&lt;/a&gt;&lt;/td&gt;').appendTo(tr);
                  tr.appendTo('#tableBody');
              };
      });
      $('a .showMore').on('click', function(event) {
          var rowindex = $(this).parent().parent().children().index($(this).parent);
          console.debug('rowindex', rowindex);
      });
  </code></pre>