Usage of alert

suggest change

The alert() method of the window object displays an alert box with a specified message and an OK or Cancel button. The text of that button depends on the browser and can’t be modified.

Syntax

alert("Hello world!");
// Or, alternatively...
window.alert("Hello world!");

Produces

An alert box is often used if you want to make sure information comes through to the user.

Note: The alert box takes the focus away from the current window, and forces the browser to read the message. Do not overuse this method, as it prevents the user from accessing other parts of the page until the box is closed. Also it stops the further code execution, until user clicks OK. (in particular, the timers which were set with setInterval() or setTimeout() don’t tick either). The alert box only works in browsers, and its design cannot be modified.

Parameter Description
message Required. Specifies the text to display in the alert box, or an object converted into a string and displayed.

Return value

alert function doesn’t return any value

Feedback about page:

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


Modals:
* Syntax
* Usage of alert

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