What are events? Where they are used.
Question :
What are events? Where they are used.
When the user manipulates a page events may be occurred. Events are fired inside the browser window, and tend to be attached to a specific item that resides in it which may be a single element, set of elements, the HTML document loaded in the current tab, or the entire browser window. JavaScript's interaction with HTML is handled through events. Events are occurred whenever a page is loaded (page load event), the user clicks a button (button click event) or events are occurred on pressing any key, closing a window, resizing a window, etc. Some more types of events may occur on:
- hovering the cursor over a certain element.
- web page finishing loading.
- A form being submitted.
- A video being played, or paused, or finishing play.
- An error occurring.
The occurrence of these events may be used by the Programmers and to execute responses coded in JavaScript like cause buttons to close windows, messages to be displayed to users, data to be validated, or any other type of response.
Events are a part of the DOM (Document Object Model) Level 3 and every HTML element contains a set of events which may trigger a block of JavaScript Code written for that specific purpose, i.e. JavaScript can "react" on these events and allows executing the code when events are detected.
The most common Events are
onchange - An HTML element has been changed
onclick - The user clicks an HTML element (button, image etc)
onmouseover - The user moves the mouse over an HTML element
onmouseout - The user moves the mouse away from an HTML element
onkeydown - The user pushes a keyboard key
onload - The browser has finished loading the page
Similar Questions
What is ng-App directive in Angular JS?
What is a controller in Angular JS?
Explain the ng-model directive in Angular JS.
What are the Angular Modules?
Distinguish between Angular JS and JavaScript expressions.
What do you understand by Angular JS?
What are the advantages of using Angular JS?
Explain what are directives? Mention some of the most commonly used directives in AngularJS application?
What are events in JavaScript and its Types?
What is an operator and what are its types?
How can you create an Array in JavaScript?
What are the features of JavaScript?
Explain what is pop() method in JavaScript?
What is JavaScript?
What are AngularJS modules?
What are events? Where they are used.
What is form validation in JavaScript? How client side validation is different from server level validation.
What are Directives in Angular Js? Explain important directives.
What is Angular JS expressions? Explain with example
What is an operator and what are its types in JavaScript?