Explain the use of pop-up windows.?
What will be an ideal response?
One common and basic use of JavaScript is to create a pop-up window. Pop-up windows are a quick and simple way to add interactivity and capture your user's attention. To add a pop-up window to an HTML page, use thescripttags and place your JavaScript code within thescriptelement.You can incorporate three types of pop-up windows in a webpage: an alert box, a confirmation box, and a prompt box. Use an alert box to display a message. This can be useful if you want to grab the user's attention with information about a special promotion. To create an alert box, use the alert() method. Following is an example of an alert box code: alert("Receive a 20% discount today!");?Use a confirmation box to confirm the user's action, such as to accept changes or to proceed to another page. To create a confirmation box, use the confirm() method. Following is an example of a confirmation box code:if (confirm("Do you wish to proceed?")) { alert("You selected OK");}else { alert("You chose to Cancel");}?Use a prompt box to capture information from a user, such as a name, and then perform an action with the information. To create a prompt box, use the prompt() method. Following is an example of a prompt box code: var name = prompt("What is your name?");if (name != null) {alert("Hello " + name);}else {alert("You did not tell me your name. ");}
You might also like to view...
Identify the letter of the choice that best matches the phrase or definition.
A. An activity that occurs at least once and lasts 24 hours or longer. B. An activity that does not involve other people or resources. C. An activity in which people and other resources are invited. D. View that shows Monday through Friday in columnar style. E. View that displays the seven days of the selected week in the appointment area. F. View that displays multiple calendars at the same time. G. Status option that shows time with a white bar. H. Status option that shows time with a slashed bar. I. Print style that prints a seven-day weekly calendar. J. Status option that shows time with a purple bar.
Removable media such as CD-Rs generally have ________ capacity and ________ latency than other forms of storage such as hard disks.
a) higher, higher b) higher, lower c) lower, higher d) lower, lower