JSFiddle - React, Tailwind, and code Playground
by ten1seven
HTML
<a href="/tests/37-Foo?_method=delete&authenticity_token=123" id="destroy">Destroy Foo!</a>
JavaScript
confirmSubmit = function() {
var agree = confirm("Are you sure?");
if (agree) {
return true;
} else {
return false;
}
};
myButton = document.getElementById("destroy");
myButton.onclick = confirmSubmit;