As the title suggests I am wondering how I can wrap text in a span before and after br within a paragraph.
My HTML is as so...
<div class="blog-container">
<div class="each-article">
<p>Text text text <br/> text text text</p>
</div>
<div class="each-article">
<p>Text text text <br/> text text text</p>
</div>
</div>
And my jQuery, which I thought would work, is
$('.blog-container .each-article p br').before().wrap('<span></span>');
What this gives me is this:
<div class="blog-container">
<div class="each-article">
<p>Text text text <br><span></span></br> text text text</p>
</div>
<div class="each-article">
<p>Text text text <br><span></span></br> text text text</p>
</div>
</div>