JSFiddle - React, Tailwind, and code Playground

by Trisox

HTML

<div class="imExisting">imExisting</div>

<div class="imHidden">imExisting</div>

CSS

.imHidden{display:none;}

JavaScript

$.extend($.expr[':'],{
    existing: function(a) {
        return true;
    }
});

if($(".imExisting").is(":existing")) {alert("It's existing!!");}

if($(".imHidden").is(":hidden")) {
  console.log("It's hidden!!");
}


//deze niet gebruiken dit is een test...
if($(".imNotExisting").is(":existing")) {
  console.log("It's existing!!");
}else{
  console.log("It's not existing!!");
}