English

What is the uses of prompt dialog box?

Advertisements

Question

What is the uses of prompt dialog box?

Short/Brief Note
Advertisements

Solution

The prompt dialog box is very useful when the user want to pop-up a text box to get user input. Thus, it enables you to interact with the user. The user needs to fill in the text box field and then click OK.

The Syntax of prompt dialog box is:

Prompt(“Message”,”defaultValue”);
(or)
window.prompt(”sometext”,”defaultText”);

Example:

prompt(“Enter Your Name:”,”Name”);
(or)
window.prompt(“Enter Your Name:”,”Name”);
shaalaa.com
Javascript Popup or Dialog Boxes
  Is there an error in this question or solution?
Chapter 14: Introduction to Javascript - Evaluation [Page 314]
Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×