title: refresh DOM after append element
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!doctype html&gt;
  &lt;html&gt;
  
  &lt;head&gt;
    &lt;title&gt;test&lt;/title&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt;
    &lt;script&gt;
      $(document).ready(function() {
        $('#main_body').append("&lt;h1&gt;Hello&lt;/h1&gt;&lt;input id=\"but\" type=\"button\"&gt;Click");
        $("#but").on("click", function() {
          alert("bla bla");
        });
      });
    &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body id="main_body"&gt;&lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Why alert doesn't work after append DOM? Should shows "bla bla" after click on it.</p>
  
  <p><strong>SOLVED</strong></p>
  
  <p>Main problem was with it:</p>
  
  <pre><code>&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>jquery was too old I think</p>
  
  <pre><code>&lt;script src="http://code.jquery.com/jquery-1.11.0.min.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>solved problem :)</p>