JSFiddle - React, Tailwind, and code Playground

HTML

<div id="t1">
    <p>hello</p>
    <p>there</p>
</div>

<ul id="t2">
    <li>hi</li>
</ul>

JavaScript

// should find 2 elements (p)
alert( $("#t1").find(":not(li)" ).length );
// should find 0 elements
alert( $("#t2").find( ":not(li)" ).length );