JSFiddle - React, Tailwind, and code Playground

HTML

<div>
    <p>first</p>
    <p>second</p>
    <p>third</p>
</div>

JavaScript

$("div p:nth-child(1)").css('background','red');
$("div p:nth-child(2)").css('background','blue');
$("div p:nth-child(3)").css('background','yellow');