Simplify all of this
<a> <input> <button> <confirm>
Using Flask
<a href="{{ url_for('products.delete', id=product.cod) }}" >Delete</a>
Flask button
<input type="button" value="Delete">
JS script
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
let text;
if (confirm("Press a button!") == true) {
text = "You pressed OK!";
} else {
text = "You canceled!";
}
document.getElementById("demo").innerHTML = text;
}
</script>
I need a function that do all of this.