Reputation: 55
got a quandary i was hoping you kind folks could help me out with...
goal:
Using jQuery, I'm trying to add all the occurrences of:
<pre> ... </pre>
with:
<pre><code> ... </code></pre>
Upvotes: 2
Views: 280
Reputation: 104775
Use the .wrapInner()
$("pre").wrapInner("<code></code>");
Upvotes: 0
Reputation: 207901
$('pre').wrapInner('<code>');
Ref: wrapInner
jsFiddle example
Reputation: 819
$('pre').html('<code>'+$('pre').html()+'</code>');