title: Dynamic element unable to select rest of DOM?
body: <p>I have a button that is dynamically added via jquery. The button exists on each row of my table and I now need to add functionality to them. The problem is that I can't seem to select the parents of my dynamically added button!</p>
  
  <p>I have tried to use jquery to get the text of the fourth parent of the button, this returns a big jquery error indicating that I broke everything.</p>
  
  <pre><code>var result = $(this).parents().eq(3).text;
  alert(result);
  </code></pre>
  
  <p>this function is called via this:</p>
  
  <pre><code>$(document).on('click','#addcommentbtn',function(){
  addcomment();
  });    
  </code></pre>
  
  <p>The text that I'm trying to fetch is four steps above the button, so I use .parents().eq(3) to select it, but it doesn't work for some reason. Any ideas?</p>