Java script popup boxes

Introduction -: In java script language providing many facility. In java script  we can create three type of popup boxes as like  Alert box,confirm box,prompt box these are here

Alert Box- : An alert box often is used if we want to make sure information come through to the user when an alert box pops up. the user will have to click ” OK” to processed.

In another words we can say that An alert dialog box is mostly used to give a warning message to the users. For example, if one input field requires to enter some text but the user does not provide any input, then as a part of validation, you can use an alert box to give a warning message.

alert(“some text”)

Confirm box-: A confirm box is often used if we want the user to verify or accept something. When confirm box pops up, the user will have to click either ok or cancel to proceed. If the user clicks “ok” the box return true. if the user click cancel the box return false. example

confirm(“some text”)

Prompt Box-: A prompt box is often used if we want the to input a value before entering a page. When a prompt box pops up the user will have to click either “ok” or “cancel ” to proceed after entering an input values if the user click “ok” the box returns the input value. if the user clicks”cancel” the box return null example like

Prompt(“some text “,default value”);

 

Leave a Comment