1// Alert used to display a message to the user.
2alert("Hello, World!"); // Displays Hello, World! to the user.
3// You can also use:
4window.alert("Hello, World!"); // Also displays Hello, World! to the user.
1<html>
2 <head>
3 <script type = "text/javascript">489</script>
10 </head>
11
12 <body>
13 <input type = "button" onclick = "sayHello()" value = "Say Hello" />
14 </body>
15</html>
13 types of JS Alerts
2
3 - Information : You can only accept.
4 - Confirmation: You can accept or decline.
5 - Prompt : You can accept, decline, and/or sendKeys.
6