JSFiddle - React, Tailwind, and code Playground

HTML

<div id="one"><p class="child1"></p></div>
<div id="two"></div>

JavaScript

var length = $('#two').children().length;
if (length > 0) {
    alert('hi');
}
if (length === 0) {
    alert('bye');
}