Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

alert function in JavaScript

window.alert()

This function is used to display data in an alert dialog box. alert function really should be used only when you truly want to stop everything and let the user know something.

Syntax :
window.alert(“Hello Chandan”);
window.alert(variable);

Example:-

Output:- (Note: if you write HTML code within this function then the HTML tag looks like as it is written.)

Result Output
Chandan Kumar
Follow Me: