JSFiddle - React, Tailwind, and code Playground
HTML
<div>
<p>Lorem Ipsum</p>
<p>Lorem Ipsum</p>
<p>Lorem Ipsum</p>
<p>Lorem Ipsum</p>
<p>Lorem Ipsum</p>
</div>
CSS
.bg-blue {
background:red;
}
JavaScript
$("div p").eq(1).css('background-color','#ccc');
$("div p").eq(3).addClass('bg-blue');