JSFiddle - React, Tailwind, and code Playground

by jfriend00

HTML

<input type="button">

<div id="something">
     <input type="button">
</div>
<div id="something2">
     <input type="button">
</div>


<input type="button">
<input type="button">
<input type="button">

CSS

#something {border: 1px solid blue}

JavaScript

var q1 = $("input[type=button]").filter(function() {
    return $(this).closest("#something").length == 0;
});

var q2 = $("input[type=button]").not("#something input[type=button]");

$(document.body).append("<hr>" + q1.length + "<br>" + q2.length);