🌐
W3Schools
w3schools.com › js › js_popup.asp
JavaScript Popup Boxes
To display line breaks inside a popup box, use a back-slash followed by the character n. ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: sales@w3schools.com · If you want to report an error, or if you want to make a suggestion, send us an e-mail: help@w3schools.com · HTML Tutorial CSS Tutorial JavaScript Tutorial How To Tutorial SQL Tutorial Python Tutorial W3.CSS Tutorial Bootstrap Tutorial PHP Tutorial Java Tutorial C++ Tutorial jQuery Tutorial
🌐
W3Schools
w3schools.com › howto › howto_js_popup.asp
How To Create Popups
Fullscreen Video Modal Boxes Delete Modal Timeline Scroll Indicator Progress Bars Skill Bar Range Sliders Color Picker Email Field Tooltips Display Element Hover Popups Collapsible Calendar HTML Includes To Do List Loaders Badges Star Rating User Rating Overlay Effect Contact Chips Cards Flip Card Profile Card Product Card Alerts Callout Notes Labels Ribbon Tag Cloud Circles Style HR Coupon List Group List Group with Badges List Without Bullets Responsive Text Cutout Text Glowing Text Fixed Footer Sticky Element Equal Height Clearfix Responsive Floats Snackbar Fullscreen Window Scroll Drawing
🌐
Mobiscroll
demo.mobiscroll.com › javascript › popup
Javascript Popup Examples | Mobiscroll
Use the popup to render any content or form in a modal box that can be programmatically shown or hidden.
🌐
EDUCBA
educba.com › home › software development › software development tutorials › javascript tutorial › javascript popup box
JavaScript Popup Box | Learn 3 Types of Popup Box in JavaScript
June 13, 2023 - Guide to JavaScript Popup Box. Here we discuss the 3 boxes which are alert, confirm and prompt box with syntax and examples to implement.
Address   Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-create-popup-box-using-html-css-and-javascript
How to create Popup Box using HTML CSS and JavaScript? - GeeksforGeeks
In JavaScript, first, get button elements through their id or class and then apply addEventListener on the Popup button as well as the Close button. "Click" event is used, popup box appears while clicking on the popup button.
Published   August 5, 2025
🌐
Quackit
quackit.com › javascript › tutorial › javascript_popup_boxes.cfm
JavaScript Popup Boxes
To create a JavaScript confirm box, you use the confirm() method. Here's an example: Prompts the user for information. Example: To create a JavaScript prompt, you use the prompt() method. Here's an example: Note that the user's browser determines what the popup box actually looks like.
🌐
Codingem
codingem.com › home › javascript popup boxes
JavaScript Popup Boxes - codingem.com
July 10, 2025 - To create a prompt box in JavaScript, use the built-in prompt() method. This method takes two arguments: The text to be displayed. The optional default text to the input field. The prompt box (the prompt() method) returns the text entered by ...
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › what-are-the-types-of-popup-box-available-in-javascript
What are the types of Popup box available in JavaScript ? - GeeksforGeeks
August 5, 2025 - In JavaScript, there are three types of popup boxes: alert, confirm, and prompt. The alert() displays a simple message, the confirm() asks the user to accept or cancel, and the prompt() requests user input with an optional default value.
🌐
W3docs
w3docs.com › javascript
How to Create a Popup Form Using JavaScript
Use the display = "block" for the openForm() and display = "none" for the closeForm() functions to show and close the form when clicked: function openTheForm() { document.getElementById("popupForm").style.display = "block"; } function closeTheForm() ...
Find elsewhere
🌐
Learn JavaScript
learn-js.org › en › Pop-up_Boxes
Pop-up Boxes - Learn JavaScript - Free Interactive JavaScript Tutorial
Make a variable test set it equal to a prompt box, and type "Hi!" in it (without the quotes) when it pops up. Note: your pop-up blocker must not be enabled. ... Hello, World! ... Copyright © learn-js.org. Read our Terms of Use and Privacy Policy
🌐
Medium
medium.com › @ladypenguin1991 › javascript-popup-boxes-1b26d0aa89dc
Javascript Popup Boxes. I believe I can comfortably say that… | by CynthiaHarris | Medium
April 16, 2023 - When it comes to developers, however, they can be quite the useful tool. To start this article, I’m going to say one thing I like about popup boxes: They are surprisingly easy to implement in your code. With that in mind, let’s take a look at three different kinds of Javascript popup boxes: alert(), confirm(), and prompt().
🌐
Js
popup.js.org
popup-js
<script src="https://cdn.jsdelivr.net/npm/@simondmc/popup-js@1.4.4/popup.min.js"></script> Create a new popup by instantiating the Popup class: const myPopup = new Popup({ id: "my-popup", title: "My First Popup", content: ` An example popup. Supports multiple lines.`, }); Display a popup on ...
🌐
Dot Net Tutorials
dotnettutorials.net › home › javascript popup boxes
JavaScript Popup Boxes with Examples - Dot Net Tutorials
June 30, 2020 - In this article, I am going to discuss JavaScript Popup Boxes with Examples. JavaScript has 3 types of popup boxes.Alert box, Confirmation box, & Prompt box
🌐
freeCodeCamp
freecodecamp.org › news › how-to-build-a-javascript-alert-box-or-popup-window
How to Build a JavaScript Alert Box or Popup Window
January 25, 2020 - Popup boxes prevent the user from ... are three different kinds of popup methods used in JavaScript: window.alert(), window.confirm() and window.prompt()....
🌐
TutorialsTeacher
tutorialsteacher.com › javascript › display-popup-message-in-javascript
JavaScript Message Boxes: alert(), confirm(), prompt()
JavaScript provides built-in global functions to display popup message boxes for different purposes. alert(message): Display a popup box with the specified message with the OK button. confirm(message): Display a popup box with the specified ...
Top answer
1 of 2
8

Here is a simple solution that will allow you to fetch value from opened window. All you need is to inject JavaScript code into opened window that will interact with the parent window using window.opener:

HTML

<input id="value" />
<button onclick="openWindow();">Open</button>

JavaScript

function openWindow() {
    var i, l, options = [{
       value: 'first',
       text: 'First'
    }, {
       value: 'second',
       text: 'Second'
    }],
    newWindow = window.open("", null, "height=200,width=400,status=yes,toolbar=no,menubar=no,location=no");  

    newWindow.document.write("<select onchange='window.opener.setValue(this.value);'>");
    for(i=0,l=options.length; i<l; i++) {
        newWindow.document.write("<option value='"+options[i].value+"'>");  
        newWindow.document.write(options[i].text);  
        newWindow.document.write("</option>");
    }
    newWindow.document.write("</select>");
}

function setValue(value) {
    document.getElementById('value').value = value;
}

Working example here: http://jsbin.com/uqamiz/1/edit

2 of 2
2

The easiest way is to have a superimposed div with a a high z-index, with transparent background acting as an overlay. You could then have another div which is centered above the overlay(with higher z-index) and containing the list markup

CSS

#shim {
opacity: .75;
filter: alpha(opacity=75);
-ms-filter: "alpha(opacity=75)";
-khtml-opacity: .75;
-moz-opacity: .75;
background: #B8B8B8;
position: absolute;
left: 0px;
top: 0px;
height: 100%;
width: 100%;
z-index:990
}

#msgbx {
position: absolute;
left: 50%;
top: 50%;
height: 150px;
width: 350px;
margin-top: -75px;
margin-left: -175px;
background: #fff;
border: 1px solid #ccc;
box-shadow: 3px 3px 7px #777;
-webkit-box-shadow: 3px 3px 7px #777;
-moz-border-radius: 22px;
-webkit-border-radius: 22px;
z-index:999
}

HTML

<div id="shim"></div>
<div id="msgbx">inject list markup here</div>

To show popup

document.getElementById('shim').style.display=document.getElementById('msgbx').style.display ="block";

To Hide

document.getElementById('shim').style.display=document.getElementById('msgbx').style.display ="none";
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Mozilla › Add-ons › WebExtensions › user_interface › Popups
Popups - Mozilla | MDN
When the user clicks anywhere outside the popup, the popup is closed. The popup can be closed programmatically by calling window.close() from a script running in the popup. However, you can't open the popup programmatically from an extension's JavaScript; it can be opened only in response to a user action.
🌐
DHTMLX
dhtmlx.com › docs › products › dhtmlxPopup
JavaScript Popup Box - dhtmlxPopup
dhtmlxPopup can be used to display a custom JavaScript popup window with any kind of content inside. A popup is usually triggered by end user actions like a click on a button.
🌐
Studytonight
studytonight.com › javascript › javascript-popup-boxes
JavaScript Popup Boxes - Studytonight
Javascript Prompt Box can be used when we want to get some user input. When Javascript displays a prompt box, the user will see a popup box with an input field and buttons "OK" or "Cancel" to proceed after entering an input value.