JSFiddle - React, Tailwind, and code Playground
HTML
<label class="myClass"></label>
<!-- I want to hide this -->
<label class="myClass">Some text here</label>
<!-- Don't hide -->
JavaScript
var label = $('label.myClass').filter(function (index) {
if ($(this).text() == "") {
return $(this)
}
})
console.log(label.attr('class'))
console.log(label.text())
console.log(label.length)