Monday, June 29, 2015

What types of pop-up boxes you can create in JavaScript and how can you create them?

  • Alert, prompt, and confirm boxes are the three main pop-up boxes that can be created in JavaScript.
  • Alert boxes are used to alert the user to important info regarding the site and require the user to click ‘OK’ in order to proceed.
  • Alert boxes are created using the following syntax:
    • window.alert(“Text”);
  • Prompt boxes prompt the user to input some form of data before proceeding.
  • Prompt boxes are created using the following syntax:
    • window.prompt(“Prompt Text”,”Default value”);
  • Confirm boxes are used when for verification, such as agreeing to a terms of service, rendering a TRUE value when the user clicks ‘OK’.
  • Confirm boxes are created with the following syntax:
    • window.confirm(“Confirm text here.”);

No comments:

Post a Comment

What is restrict option in directive?

The restrict option in angular directive, is used to specify how a directive will be invoked in your angular app i.e. as an attribute, class...