I have some code which is in a pre tag. the output is this:
<div class="Message">
<pre class="Codeblock>
<!-- code goes here -->
</pre>
</div>
Now I want to create a div around this pre block like this:
<div class="Message">
<div id="firstblock">
<pre class="Codeblock>
<!-- code goes here -->
</pre>
</div>
</div>
I tried already this:
var extradiv = document.createElement('div');
extradiv.id = 'firstblock';
$('.Message').prepend(extradiv);
But that creates the div open end close before the pre tag