You can simply call redirect() at the end of function alertA(){...}
function alertA() {
var name = prompt("What's your first name");
if (name.length < 13) {
alert("Hi Paul")
} else {
alert("Don't lie, your name is Paul");
}
redirect() // <<<<<<<----- calling next function
}
function redirect() {
var r = confirm("Do you think Lee has learned JavaScript? If yes click OK")
if (r == true) {
window.location = 'http://www.youtube.com';
} else {
window.location = 'http://www.google.com';
}
}
You could also merge both functions into a single one:
function alertA() {
var name = prompt("What's your first name");
if (name.length < 13) {
alert("Hi Paul")
} else {
alert("Don't lie, your name is Paul");
}
var r = confirm("Do you think Lee has learned JavaScript? If yes click OK")
if (r == true) {
window.location = 'http://www.youtube.com';
} else {
window.location = 'http://www.google.com';
}
}
Answer from franciscod on Stack OverflowW3Schools
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 ...
popup - Basic JavaScript pop up boxes - Stack Overflow
Can anyone see where I am doing wrong? I'd like each function to run after each other. Is this even possible the way I am doing it? Thanks Java Scr... More on stackoverflow.com
javascript - How to create a popup box where users can copy text? - Stack Overflow
In my HTML page I generate a link, where users can grab to use for things. I need to somehow give the user the link where they can see the link and then copy the link to clip board. I don't mean ... More on stackoverflow.com
4 Ways to Create a Modal Popup Box with Html, CSS and Vanilla JavaScript
This tutorial includes no mention of accessibility, and because it doesn't trap focus, can actually result in a bad user experience. I recommend looking over the W3 modal tutorial and incorporating some of the points about focus trapping and accessibility into this one https://www.w3.org/TR/wai-aria-practices-1.1/examples/dialog-modal/dialog.html More on reddit.com
JavaScript Popup Dialogue Box not Opening
When I use the example ...-i-create-interactive-stamps/) that Bluebeam provides and edit it, I can no longer get the dialog box to pop up when I place the stamp on a page. All I need to do is generate a script dialog that has fillable text fields (Date Received, Date Returned, Reviewed By, etc.). But when I edit the JavaScript from the example ... More on reddit.com
Videos
How To Make A Popup Using HTML, CSS And JavaScript ...
09:36
How To Create Model Popup Box Using HTML CSS and JavaScript - YouTube
05:43
Popup Boxes - Javascript Programming 15 - YouTube
01:08
Build a Popup with JavaScript | 1-Minute Tutorial - YouTube
Custom Popup Boxes - With HTML, CSS and JavaScript
Reddit
reddit.com › r/learnprogramming › 4 ways to create a modal popup box with html, css and vanilla javascript
r/learnprogramming on Reddit: 4 Ways to Create a Modal Popup Box with Html, CSS and Vanilla JavaScript
January 30, 2021 -
4 Ways to Create a Modal Popup Box with Html, CSS and Vanilla JavaScript - The Code Angle
Top answer 1 of 5
50
This tutorial includes no mention of accessibility, and because it doesn't trap focus, can actually result in a bad user experience. I recommend looking over the W3 modal tutorial and incorporating some of the points about focus trapping and accessibility into this one https://www.w3.org/TR/wai-aria-practices-1.1/examples/dialog-modal/dialog.html
2 of 5
10
Speaking of pop-ups, the pop-up requesting me to subscribe to their mailing list takes up half my phone screen, so I can't read the article
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().
MDN Web Docs
developer.mozilla.org › en-US › docs › Mozilla › Add-ons › WebExtensions › user_interface › Popups
Popups - Mozilla | MDN
Unlike a normal page, though, the JavaScript can use all the WebExtension APIs that the extension has permissions for. The popup's document is loaded every time the popup is shown, and unloaded every time the popup is closed. The HTML file is included in the extension and specified as part of the browser_action or page_action key by "default_popup" in the manifest.json:
SweetAlert2
sweetalert2.github.io
SweetAlert2 - a beautiful, responsive, customizable and accessible (WAI-ARIA) replacement for JavaScript's popup boxes
SweetAlert2 - a beautiful, responsive, customizable and accessible (WAI-ARIA) replacement for JavaScript's popup boxes
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
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
NIELIT
nielit.gov.in › gorakhpur › sites › default › files › Gorakhpur › OLEVEL_1_WPD_26_May_2020_IL.pdf pdf
Pop up boxes in JavaScript - Gorakhpur
To do such things on webpages, JavaScript provides mainly three types of pop-up or · dialog boxes. These are · 1. Alert Dialog Box · 2. Confirmation Dialog Box · 3. Prompt Dialog Box · 1. Alert Dialog Box · Alert box gives only one button "OK” and it is mandatorily be clicked to close ...
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 - Popup boxes like alert, prompt, and confirm boxes give the user further step information. Alert Box for the warning, prompt box input values, and confirm Box for the user’s decision. This is a guide to JavaScript Popup Box. Here we discuss the three alert boxes, confirm and prompt Box, with syntax and examples to implement.
Call +917738666252
Address Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
Way2tutorial
way2tutorial.com › javascript › javascript-popup-boxes.php
JavaScript Popup Boxes
JavaScript Popup boxes are three types alert box, confirm box, prompt box. JavaScript Alert Box (alert message display to a browser), JavaScript Confirm Box (verify or accept some confirm message from user and display on bowser), JavaScript Prompt Box (fetch value from user and display on browser).
Top answer 1 of 6
2
You could use jQuery ui .dialog()
JS:
$(function() {
$( "#dialog" ).dialog();
});
HTML:
<div id="dialog" title="Basic dialog">
<p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>
2 of 6
2
You could try and use window.prompt() and do something like this: http://www.w3schools.com/js/tryit.asp?filename=tryjs_prompt where you can copy the text from the input, which can default to the link.