JSFiddle - React, Tailwind, and code Playground
by ChrisStanyon
HTML
<div id="myDiv">
<p>Paragraph 1</p>
<p>Paragraph 2</p>
<p>Paragraph 3</p>
</div>
CSS
div { border: 1px solid green; width: 100px; padding: 10px; }
.red { color:Red; }
JavaScript
$.fn.highlightRows = function() {
var testItems = this.get(0).getElementsByTagName("p");
$.each(testItems, function(index, elem) {
$(elem).addClass("red");
});
};
$('#myDiv').highlightRows();