Read value in textbox and add some extension - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Text

Description

Read value in textbox and add some extension

Demo Code

ResultView the demo in separate window

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

Related Tutorials