alert() method displays an alert dialog with a specified message and an OK button.
Note: The alert dialog should be used for messages which do not require any response on the part of the user, other than the acknowledgement of the message.
alert() as HTML Attribute Value
|message||Optional||Specifies the text/number to display in the alert box.|
Message can either be in string or number.
All are checked by myself
alert() inside <script> tag
alert() with Escape Sequence
In the following example, we will use the escape sequence '\n' (new line) to display the following text in new line.
alert() with Property
In the following example, we will using the location.hostname property to display the hostname.
Please do google search for:
Join Our Channel
This channel is primarily useful for Full Stack Web Developer.