JSFiddle - React, Tailwind, and code Playground

HTML

<body>
<form id="form1">
    <input type="text"/>
    <input type="submit"/>
</form>
</body>

JavaScript

var form1 = document.getElementById('form1');
form1.onsubmit = function(e){
    var form = this;
    e.preventDefault();
    if(confirm("Are you sure you wish to delete?"))
        form.submit();
}