JSFiddle - React, Tailwind, and code Playground
HTML
<form id="contactform" action="" method="post">
<input type="submit" name="submit">
</form>
<script>
let formulier = document.querySelector("#contactform");
formulier.addEventListener('submit', function(event) {
if (confirm("Druk op OK als u het formulier wenst te versturen.") == false) {
event.preventDefault();
}
});
</script>