title: JQuery - Check if each dynamically added button clicked
body: <p>I have buttons being added to an element via JQuery Ajax and a PHP script.  The number of buttons being added is variable.  I want to be able to check if each button has been clicked before enabling another action.</p>
  
  <p>The relevant code in the PHP script is as follows with each button having an incremented ID:</p>
  
  <pre><code>$i = 1;
  while ($row = mysql_fetch_array($result)) {
  echo "&lt;div class='dr_feedback_btn' id='dr_" . $i++ . "'&gt;Feedback&lt;/div&gt;";
  }
  </code></pre>
  
  <p>I have the following code in JQuery for the button click based on the button class:</p>
  
  <pre><code>    $('#dr_container').on('click', '.dr_feedback_btn', function() {
           ...
      });
  </code></pre>
  
  <p>The image below shows the feedback buttons.</p>
  
  <p><a href="https://i.stack.imgur.com/tnxc8.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tnxc8.jpg" alt="enter image description here"></a></p>
  
  <p>Any help appreciated.</p>