JSFiddle - React, Tailwind, and code Playground

HTML

<h3>Highlight first "empty" paragraph in yellow:</h3>

<div id="foo">  
    <p>
       Text content here
    </p>
    
</div>

CSS

p { height: 20px; border: 1px solid red; }

JavaScript

$('div#foo').find('p').filter(function() {   
    $('p').contents().unwrap();
    return !($.trim($(this).text()).length);
}).first();