About User Prompts

suggest change

User Prompts are methods part of the Web Application API used to invoke Browser modals requesting a user action such as confirmation or input.

window.alert(message)

Show a modal popup with a message to the user.

Requires the user to click [OK] to dismiss.

alert("Hello World");

More information below in “Using alert()”.

boolean = window.confirm(message)

Show a modal popup with the provided message.

Provides [OK] and [Cancel] buttons which will respond with a boolean value true / false respectively.

confirm("Delete this comment?");

result = window.prompt(message, defaultValue)

Show a modal popup with the provided message and an input field with an optional pre-filled value.

Returns as result the user provided input value.

prompt("Enter your website address", "http://");

More information below in “Usage of prompt()”.

window.print()

Opens a modal with document print options.

print();

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Modals:
* Syntax
* About User Prompts

Table Of Contents
11 Arrays
12 Objects
14 Classes
16 Map
17 Set
24 Loops
27 Date
29 Scope
30 AJAX
35 Cookies
41 JSON
44 Fetch
45 Modules
46 Screen
64 Console
68 Symbols
73 Modals
76 Events
86 Proxy
89 WeakMap
90 WeakSet
102 Tilde