title: jQuery not retruning data-id after the first use of the button
body: <p>I have a php script that creates a table and each id in the table has an edit button. The edit button looks like this.</p>
  <pre><code>&lt;button data-siteid=&quot;'.$row-&gt;site_sn_id.'&quot; class=&quot;btn btn-link p-0 m-0&quot; style=&quot;font-size:.7rem&quot; id=&quot;editBtn&quot; type=&quot;button&quot; &gt;Edit&lt;/button&gt;
  </code></pre>
  <p>The number of buttons varies but I am trying to get the data-siteid passed to an ajax call like this.</p>
  <pre><code>$(&quot;#editBtn&quot;).on(&quot;click&quot;, function(){
          var siteID = $(this).data('siteid');
          $.ajax({
              method: &quot;POST&quot;,
              url: &quot;edit-modal.php&quot;,
              data: {siteID: siteID}
          })
                  .done(function( msg ) {
                      $('#editModal').modal('show');
                      $(&quot;#bodyContent&quot;).html(msg);
                  });
      });
  </code></pre>
  <p>Its working on the first edit button of the table but it does nothing after that first button. It wont even open the modal.</p>