title: jquery not get row id
body: <p>i have the next code in html</p>
  
  <pre><code>&lt;tr id='1'&gt;
  &lt;td&gt;'
     &lt;a href='#'&gt;&lt;i class='icon-pencil'&gt;&lt;/i&gt;&lt;/a&gt; 
     &lt;a href='#myModal' role='button' data-toggle='modal'&gt;&lt;i class='icon-remove' &gt;&lt;/i&gt;&lt;/a&gt;
  &gt;&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>and the next code in javascript code</p>
  
  <pre><code>$("a").click(function () {
      var id = $(this).closest("tr").attr('id');
      console.log(id);
  });
  </code></pre>
  
  <p>but not works, for get the row id</p>
  
  <p>EDIT:
  i put the next function out of $(document).ready(function () </p>
  
  <pre><code>function getId(idd) 
  {
    var id = $(idd).closest("tr").attr('id');
  }
  </code></pre>
  
  <p>and add onclick='getId(this);' to .
  Is not the best method, but works.</p>
  
  <p>PD: and i have the tag table, mi fault for no put the full code</p>