JSFiddle - React, Tailwind, and code Playground
HTML
<li>One
<ul></ul>
</li>
<li>Two
</li>
<p>
<li>Three
<ul></ul>
</li>
<li>Four
</li>
</p>
JavaScript
// This is the one that is inconsistent across versions:
$('li').has('li ul').css('background-color','red');
// Was curious about this one, it doesn't match with any version available here:
$('li').has('p li ul').css('background-color','blue');