<button onclick="return confirm('Are you sure you want to Delete?');"
id="btnDelete">DELETE</button>
Category: before
how to run js before submit html
<form onsubmit="return do_something()">
function do_something(){
// Do your stuff here
return true; // submit the form
return false; // don't submit the form
}