How to create a simple HTML Cancel button
I am playing with the
http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_button_type Tryit
HTML Editor and I am try to figure out how to make my browser re-direct to
an URL when I click on the "Cancel" button. But I cannot figure it out.
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='http://stackoverflow.com';">Cancel</button>
</form>
</body>
</html>
... what am I doing wrong here?
Thanks
No comments:
Post a Comment