title: Click not detected by dynamicly added jquery script
body: <p>Thanks for your attention.</p>
  
  <p>I have a DOM in which one I dynamicly insert a JS script element using :</p>
  
  <pre><code>var script = document.createElement("script");
  script.id = "dynJS";
  script.type = "type/javascript";
  document.body.appendChild(script);
  </code></pre>
  
  <p>Some events later, I generate buttons in the page. Then, I add the following code in this script element to listen the click on these buttons :</p>
  
  <pre><code>$(document).ready(function(){
      $(document).on("click", "button#but1", function(){
          alert("click A");
      }
  }
  </code></pre>
  
  <p>(respectively for the other buttons)</p>
  
  <p>But the click isn't detected. Does anyone know why ?</p>
  
  <p><strong>EDIT : Problem solved.</strong></p>
  
  <p>Thanks to the comments, I fix the issue moving the delegated click listener in a code pre-existing the buttons add, avoiding the redundant script add.</p>
  
  <p>Thanks a lot for the help.</p>