I have an h2 and some text:
<h2>Test</h2>
Lorem ipsum dolor hener ait
I need need to wrap the text "lorem ipsum dolor hener ait" in a <p>
element. Hoping to get this result:
<h2>Test</h2>
<p>Lorem ipsum dolor hener ait</p>
Currently, I have this:
$('h2').each(function() {
$(this).next().wrapAll('p');
});
But it does not work. How I can resolve this issue?