JavaScript: How to create alerts and pop-up windows

In JavaScript, alerts can be created easily using the built-in alert() function. For this first example, an alert is placed directly inside the button tag: <button onclick=”alert(‘I am an alert box!’);”>Example 1</button> Example 1 Here is a more complete example, showing in the HTML context: <!DOCTYPE html> <html> <body> <h2>JavaScript Alert Example 1</h2> <button onclick=”alert(‘I … Continue reading JavaScript: How to create alerts and pop-up windows