title: Wrap <a> around <div> without jQuery
body: <p>I'm trying to wrap an <code>&lt;a&gt;</code> around a <code>&lt;div&gt;</code> without using jQuery since I don't want to embed the jQuery library. Is it possible with pure JavaScript?</p>
  
  <p>The jQuery solution works great and looks like this:</p>
  
  <pre><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;
      $(document).ready(function() {
          $("#mydiv").wrap("&lt;a id='myanchor' href='#'&gt;&lt;/a&gt;");
      });
  &lt;/script&gt;
  </code></pre>