Snippet. JavaScript: How to Open a PopUp WindowThis JavaScript snippet shows how to open a popup window. Open Popup Clicking on Button<button onclick="javascript:var id=new Date().getTime();window.open('',id,'width=800, height=600, toolbar=0, location=0, directories=0, status=1, menubar=0, scrollbars=0, resizable=1, modal=yes,alwaysRaised=yes').focus(); return false;">Click to open a popup window</button> Test it yourselfOpen Popup Clicking on ButtonAnd this is how to open a popup window when clicking on a hyperlink. <a href="#" onclick="javascript:var id=new Date().getTime();window.open('',id,'width=800, height=600, toolbar=0, location=0, directories=0, status=1, menubar=0, scrollbars=0, resizable=1, modal=yes,alwaysRaised=yes').focus(); return false;">Click to open a popup window</a> Test it yourselfClick to open a popup windowUpdated on: 23 Nov 2024 |
|