How to create a HTML Cancel button that redirects to a URL
问题 I am playing with the Buttons in the w3schools Tryit editor, and I am trying to figure out how to make my browser redirect to an URL when I click on the "Cancel" button. Here's what I have tried: <form action="demo_form.asp" method="get"> First name: <input type="text" name="fname"><br> Last name: <input type="text" name="lname"><br> <button type="submit" value="Submit">Submit</button> <button type="reset" value="Reset">Reset</button> <button type="cancel" onclick="javascript:window.location=