Home
<!DOCTYPE html> <html> <body> <h1>Demo: alert()</h1> <button onclick="displayInfo()">Display Messages</button> <script> function displayInfo(){ alert("This is an alert message box."); // display string message alert('This is a numer: ' + 100); // display result of a concatenation alert(100); // display number alert(Date()); // display current date } </script> </body> </html>
Result: