I am new to Jquery, My requirement is to merge two paragraphs into single paragraph. I have tried using the following code.
<p>This is first para text </p>
<p>This is second para text </p>
<p>This is third para text.</p>
into
<p>This is first para text This is second para text This is third para text.</p>
It doesn't work. Any ideas?
Only one line code:
$('p').contents().unwrap().wrapAll('<p>');
See the demo.
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