I have a page with several .desc divs. I want to add some html to the last paragrahs within these divs.
I have tried this..
$(".desc p:last").append(" <span class='orange readMore'>Read More</span> <span class='orange readLess'>Read Less</span>");
However this just adds it to the last paragraph of that div in the whole page. Not to each last paragrapgh within .desc div. If this makes sense…
<div class="desc">
<p>Description1</p>
</div>
<div class="desc">
<p>Description2 <span class="orange readMore" style="display: inline; ">Read More</span> <span class="orange readLess" style="display: none; ">Read Less</span></p>
</div>
Something like this maybe?