The scope defines the accessibility of a variable, objects, and function. It is nothing but the boundary line.
There are only two types of scope:
1. Local Scope
2. Global Scope
It defines that something is only accessible in a limited scope. When you declare a variable within the function, it becomes local to that function. It's not accessible to the other functions or outside the function.
Inside the function
My name is Algos
Outside the function
My name is
My Name is Algos
All the objects have properties and methods. Some objects also have "events". Every element on a Web page has certain events that can trigger invocation of the event handlers. The "event handler" is a command that is used to specify the actions in response to an event. Attributes are inserted into HTML tags to define the events and event handlers.
Different types of events are listed below:
1. Mouse click event.
2. Web page or an image loading.
3. Moussing over a hot spot on the web page.
4. Selecting an input box in an HTML form.
5. Submitting an HTML form.
Example: onclick event