title: button click event not working after append data from php
body: <p>I am loading html with javascript from php to a div using $.get() to a div. the button click event is working fine. then adding again same thing again to different div with different id, but it is not working. can anyone can help me. my code is this</p>
  
  <pre><code>&lt;style&gt;
      .loadWindow {
          width:333px;
          height: 202px;
          padding: 5px 5px 0 5px;
          font: 12px Arial, Helvetica, sans-serif;
          border:double;
      }
  
      #loadWindow {
          display:none;
      }
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;div id="main-box"&gt;
  &lt;div class="loadWindow" id="loadWindow"&gt;&lt;/div&gt;&lt;button id="make"&gt;make&lt;/button&gt;
  </code></pre>
  
  <p> My javascript code is below
  </p>
  
  <pre><code>$(function(){
      $('#make').click(function(){
          var id = $('.loadWindow').length;
          var aw = $('#loadWindow').clone().attr("id", "window"+id);
  
          //load data from php
          $.get("mydata.php", function(data) {
              aw.html(data);  
              $('#main-box').append(aw);
              aw.show();
          }, 'json');
      });
  });
  </code></pre>
  
  <p>`</p>
  
  <p>My mydata.php code is below</p>
  
  <pre><code>echo '&lt;div&gt;&lt;button id="closeBtn"&gt;Close&lt;/button&gt;&lt;/div&gt;&lt;script&gt;$("#closeBtn").click(function(){alert("Close button Clicked!");});&lt;/script&gt;';
  </code></pre>
  
  <p>
  
  <p>I want click event work for each window separately(individually) and display the alert. In this code click event is not working according to the window. What can I do?</p>