How to open website in new window when click on a button in browser with JavaScript

1 Answer

0 votes
<!DOCTYPE html>
<html>
<head>  

<input type="button" value="Open website" onclick="open_website('http://www.avibootz.com/')">

<script>

function open_website(ws) 
{
    window.open(ws, 
                "_blank", 
                "toolbar = yes, " + 
                "location = yes, " + 
                "directories = no, " + 
                "status = no, " + 
                "menubar = yes, " + 
                "scrollbars = yes, " + 
                "resizable = no, " + 
                "copyhistory = yes, " + 
                "width = 500, " + 
                "height = 500");
}

/*                          
run:

on button click website will open in new window
  
*/

</script>

</body>
</html>

 



answered Aug 30, 2015 by avibootz
...