Source Code:
(back to article)
Submit
Result:
Report an issue
<p>Click the button to trigger the popup!</p> <button onclick="openPopup()">Open Popup</button> <script> // Function to open a new popup with a message function openPopup() { let newWindow = window.open("", "Example", "width=400,height=400"); newWindow.document.write("<h1>Welcome to our popup!</h1>"); } </script>