Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
What are the pop-up boxes available in JavaScript?
Home
JavaScript
What are the pop-up boxes available in JavaScript?
0
votes
asked
Jun 9, 2022
in
JavaScript
by
sharadyadav1986
What are the pop-up boxes available in JavaScript?
pop-up-box
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Jun 9, 2022
by
sharadyadav1986
Below are some examples of popup boxes in javascript
Alert Box
Confirm Box
Prompt Box
Example of alert() in JavaScript
<
script
type
=
"text/javascript"
>
function msg(){
alert("Hello Alert Box");
}
</
script
>
<
input
type
=
"button"
value
=
"click"
onclick
=
"msg()"
/>
Example of confirm() in JavaScript
<
script
type
=
"text/javascript"
>
function msg(){
var
v
=
confirm
("Are u sure?");
if(
v
==true){
alert("ok");
}
else{
alert("cancel");
}
}
</
script
>
<
input
type
=
"button"
value
=
"delete record"
onclick
=
"msg()"
/>
Example of prompt() in JavaScript
<
script
type
=
"text/javascript"
>
function msg(){
var
v
=
prompt
("Who are you?");
alert("I am "+v);
}
</
script
>
<
input
type
=
"button"
value
=
"click"
onclick
=
"msg()"
/>
Your comment on this answer:
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Related questions
0
votes
Q: What are the types of Pop up boxes available in JavaScript?
asked
Oct 10, 2022
in
JavaScript
by
SakshiSharma
javascript
pop-up-box
0
votes
Q: Can we handle a windows-based pop-up in Selenium, and if not, then what are the alternatives?
asked
Jan 7
in
Selenium
by
SakshiSharma
windows-based-pop-up
0
votes
Q: SnackBar Widget is utilized if we have to allow our application to pop up the message ..………………….. at the bottom of our app interface.
asked
May 17, 2023
in
Flutter
by
Robin
flutter
0
votes
Q: Which of the following malware is designed for advertising, such as pop-up screens?
asked
Oct 23, 2021
in
Cyber Security
by
john ganales
malware
0
votes
Q: How can we handle windows based pop up?
asked
Aug 22, 2019
in
Selenium
by
john ganales
#selenium-for-load-testing
selenium-bot-detection
selenium-for-ios
ios-selenium
automated-visual-testing-
selenium
load-testing-selenium
python-selenium
selenium-online-training-videos
learning-selenium
selenium-syllabus
selenium-tools-for-testing
selenium-element
0
votes
Q: How can we handle web based pop-up?
asked
Aug 22, 2019
in
Selenium
by
john ganales
#selenium-for-load-testing
selenium-bot-detection
selenium-for-ios
ios-selenium
automated-visual-testing-
selenium
load-testing-selenium
python-selenium
selenium-online-training-videos
learning-selenium
selenium-syllabus
selenium-tools-for-testing
selenium-element
0
votes
Q: How to Login into any site if it is showing an Authentication Pop-Up for Username and Password?
asked
Aug 22, 2019
in
Selenium
by
john ganales
#selenium-for-load-testing
selenium-bot-detection
selenium-for-ios
ios-selenium
automated-visual-testing-
selenium
load-testing-selenium
python-selenium
selenium-online-training-videos
learning-selenium
selenium-syllabus
selenium-tools-for-testing
selenium-element
0
votes
Q: Using Pop in list will remove the popped up item.
asked
May 17, 2019
in
Python
by
Derya
#python
Python-questions-answers
0
votes
Q: What are the bitwise operators available in javascript?
asked
Oct 8, 2023
in
JavaScript
by
JackTerrance
javascript-interview-questions-answers
0
votes
Q: What are the events available for server sent events in Javascript?
asked
Sep 29, 2023
in
JavaScript
by
JackTerrance
javascript-interview-questions-answers
...