Javascript examples for DOM HTML Element:Form Event
Set href value for window location from input box
<html> <head></head> <body> <input type="text" id="txt"> <input type="button" onclick="redirect()" value="redirect"> <script type="text/javascript"> function redirect() {//from w ww .j a v a 2s .c o m var url = document.getElementById("txt").value; window.location.href = url + "html"; } </script> </body> </html>