What I want is to wrap all my p tags in a special div having a class p_wrapper. I want something like this:(For all elements not only for p and div)
$('p').wrappAll('.p_wrapper')
I should get this HTML:
<p>This is a paragraph!</p>
<p>This is another paragraph!</p>
<div class="p_wrapper"> <p>This is a paragraph!</p> </div>
<div class="p_wrapper"> <p>This is another paragraph!</p> </div>
$("p").wrap($("<div/>").addClass("p_wrapper"));
http://jsfiddle.net/aXwDs/1/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With