title: wrap content in a div using jquery
body: <p>I am trying to wrap content in a div but the problem is the html page is not editable so I am trying other way, using jQuery to wrap all the content in a <code>div</code> following is the <code>html</code> structure</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function() {
    $("hr").before("&lt;div class=wrapElement&gt;");
   $("#disqus_thread").before("&lt;/div&gt;");
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;hr&gt;
  &lt;h4&gt;Title Here&lt;/h4&gt;
  &lt;p&gt;&amp;nbsp;&lt;/p&gt;
  &lt;p&gt;&amp;nbsp;&lt;/p&gt;
  &lt;p&gt;&amp;nbsp;&lt;/p&gt;
  &lt;div id="disqus_thread"&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><strong>Problem</strong> opening <code>div</code> is placed on correct position, but closing div is not on correct position, it should be above <code>div id="disqus_thread"</code> but its not there, how do I get it placed on this position? </p>
  
  <p>jQuery version is 1.12.4</p>
  
  <p>thanks in advance</p>