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