title: How to get jQuery or Javascript to recognize a dynamically created button?
body: <p>So I've spent all afternoon trying to get this to work and it doesn't seem like it should be this difficult but it is.  Long story short I have a dynamically created button that is only generated with the following identifier...</p>
  <pre><code>&lt;a class=&quot;delete-row&quot; href=&quot;javascript:void(0)&quot;&gt;Del&lt;/a&gt;
  </code></pre>
  <p>It's created in a Javascript program.  It works fine.  The problem is when the user clicks on this button I want it to fire off a function but because the button is defined within a program I'm having a hard time capturing it.  It's a dynamically created button without a unique qualifier.  I have tried various OnClick or Click pieces of code...and to no avail.  Any clues as to what I might be doing wrong?  I am familiar with onclick scenarios and have gotten them to work before.  I believe my challenge here is because the button is being created dynamically.</p>
  <p>I've tried something like...</p>
  <pre><code>$(document).ready(function(){
      $(document).on(&quot;click&quot;,&quot;.delete-row&quot;,function()
      {
          console.log(&quot;Test&quot;); 
      });
  });
  </code></pre>
  <p>And it's not working.  Do I need to add an event listener perhaps?</p>
  <p>Thanks in advance for any suggestions.</p>