JSFiddle - React, Tailwind, and code Playground

by kthornbloom

JavaScript

const thing = document.querySelector('.this-doesnt-exist');

if(thing){
alert('it exists!');
} else {
alert('it doesnt exist!');
}