JSFiddle - React, Tailwind, and code Playground
by zaknotzak
HTML
<div id="posts">
<p>Content goes here....<a href="example.htm">Click here to read more.</a></p>
<p>More content goes here....<a href="anothertest.htm">Click here to read more.</a></p>
<p>Content goes here....<a href="helloworld.htm">Click here to read more.</a></p>
</div>
CSS
.readmore {
background: yellow;
}
JavaScript
$("#posts").children("p").each(function(i, element) {
var element = $(element);
element.html(element.html().replace("....", ".")).children("a").addClass("readmore");
});