Set URL to window location - Javascript Browser Object Model

Javascript examples for Browser Object Model:Location


Set URL to window location

Demo Code

ResultView the demo in separate window

         <input type="text" id="search"> 
      <input type="button" value="Login" onclick="myFunction()"> 
            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

Related Tutorials