Set URL to window location - Javascript Browser Object Model

Javascript examples for Browser Object Model:Location

Description

Set URL to window location

Demo Code

ResultView the demo in separate window

<html>
   <head></head>
   <body> 
      <form> 
         <input type="text" id="search"> 
      </form> 
      <input type="button" value="Login" onclick="myFunction()"> 
      <script>
            function myFunction() {
                 var search = document.getElementById("search").value;
                 var url = "https://" + search + "/uc_admin";
                 window.location = url//from   w w  w  .  ja  va2 s .c o  m
            };
            
      </script>  
   </body>
</html>

Related Tutorials