JSFiddle - React, Tailwind, and code Playground

by techiedelight

HTML

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

JavaScript

if (document.getElementById("name") !== null) {
  alert("The element exists");
} else {
  alert("The element does not exist");
}