JSFiddle - React, Tailwind, and code Playground
HTML
<input id="textButton" type="text" value=" "/>
<input id="submitButton" type="submit" value=" "/>
JavaScript
function alert1(event){
alert('1');
var entered = $('#textButton').val();
if(entered.toLowerCase() === "no"){
event.stopImmediatePropagation();
return false;
}else {
return true;
}
}
function alert2(event){
alert('2');
}
$("#submitButton").on("click",alert1);
$("#submitButton").on("click",alert2);