JSFiddle - React, Tailwind, and code Playground

by akash singh

HTML

<form onsubmit="return checkForm(this);" action="www.google.com">
<p><input type="checkbox" name="terms" id="terms"> I accept</p>
<p><input class="button" type="submit" value="Continue" ></p>
</form>

JavaScript

function checkForm(form)
{
if(!form.terms.checked){
alert("Please indicate that you accept");
  //  var cb=ducument.getElementById("terms");
document.getElementById("terms").focus();
return false;
}
return true;

}