title: Is there any function in javascript, to detect a change in document?
body: <p>I have an HTML page, which contains many select boxes, to beautify those boxes I have used "select2", What I have done is:</p>
  
  <pre><code>$(document).ready(function() { $("select").select2(); });
  </code></pre>
  
  <p>This makes all of the select boxes to get transform like "select2".
  But now I am generating the tables on a button click(after the document is ready), therefore the newly generated select boxes doesn't looks like "select2", Please help me if there is any function that detects the change in document?<br>
  Something like:</p>
  
  <pre><code>$(document).change(function() { $("select").select2(); });
  </code></pre>