The Window alert method displays a visual alert box on screen.
This method parameter is displayed to the user in plain text:
Syntax 1- window.alert(message)
Syntax 2- alert(message)
Note:- Window is global object.
Code:-window.alert("Do you want real to send request?");
Output:-
Note:- Alert method is technically a property of window. so that's why it becomes a global object and we can use this any window.
Alert always acts as a modal prompt that means the code calling alert
will pause/hold until the prompt is not answered . that means no other JavaScript
code will execute until the alert is dismissed:
JavaScript Code to hold the Display-
alert('Pause!');
console.log('Alert was dismissed');
This method parameter is displayed to the user in plain text:
Syntax 1- window.alert(message)
Syntax 2- alert(message)
Note:- Window is global object.
Code:-window.alert("Do you want real to send request?");
Output:-
Note:- Alert method is technically a property of window. so that's why it becomes a global object and we can use this any window.
Alert always acts as a modal prompt that means the code calling alert
will pause/hold until the prompt is not answered . that means no other JavaScript
code will execute until the alert is dismissed:
JavaScript Code to hold the Display-
alert('Pause!');
console.log('Alert was dismissed');
Thanks For Useful Content
ReplyDelete