Javascript examples for DOM HTML Element:Input Button
Submitting a form and do not override location.href in a submit button click handler
<html> <head> <script type="text/javascript"> function redirect() {/*w ww .j a v a 2 s. c om*/ window.location.href = "http://www.example.com"; return false; } </script> </head> <body> <form method="GET" action=""> <input type="submit" id="submitbtn" value="Submit" onclick="return redirect()"> </form> </body> </html>