Open in new window - Javascript Browser Object Model

Javascript examples for Browser Object Model:Window open

Description

Open in new window

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
function goToPage() {//  w ww.jav a2  s . co m
  var url = document.querySelector("[type=\"text\"]").value
   window.open(url, "_blank", )
}

      </script> 
   </head> 
   <body> 
      <form> 
         <input type="text" id="USPS_Tracking_Number"> 
         <input type="button" value="Check Number" onclick="goToPage();"> 
         <input type="reset" value="Reset"> 
      </form>  
   </body>
</html>

Related Tutorials