JSFiddle - React, Tailwind, and code Playground

by techiedelight

HTML

<label>Email address: <input type="email" id="name" placeholder="Enter email"></label>

JavaScript

$(document).ready(function() {
  if ($("#name")[0]) {
    alert("The element exists");
  } else {
    alert("The element does not exist");
  }
});