JSFiddle - React, Tailwind, and code Playground

HTML

<form id="frm">
    <input type="button" name="buttons" value="button" />
</form>

JavaScript

if (document.forms[0].buttons) 
    alert('yes') 
else
    alert("no");