JavaScript Methods - window.alert()

A002JS

JavaScript is a scripting language that uses objects. For example, your browser window is an object. We can refer to this object via JavaScript by using "window."

The following is a method (action) of the window object. This method is called by using the following code:

window.alert("Welcome to my Web page!"); Here's the code used to create the window.alert:
            <script>
            
                // Use code to alert your user
                // Use the alert method of the window object
             
            
            window.alert("Welcome to my Web page!")
            </script>