JSFiddle - React, Tailwind, and code Playground
HTML
<script>
function test(){
var msg = "Please click OK to proceed, Cancel to exit..";
if(confirm(msg)){
alert("clicked OK");
}
}
</script>
<input type="submit" value="submit" onclick="test()"/>