0
I would like to know how to add above and below several paragraphs with jquery.
Say, I have to take the third paragraph and add a <div>
and finalize the </div>
in the penultimate paragraph.
<p>1</p>
<p>2</p>
<p>3</p>
<p>4</p>
<p>5</p>
<p>6</p>
<p>7</p>
The result would be this:
<p>1</p>
<p>2</p>
<div>
<p>3</p>
<p>4</p>
<p>5</p>
<p>6</p>
</div>
<p>7</p>
I tried with after
and before
, but the browser closes the tags.