EVENTS AND EVENT LISTENERS IN JAVASCRIPT | JAVASCRIPT TUTORIALS IN HINDI
common events Event Description onchange - An HTML element has been changed onclick - The user clicks an HTML element 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 The addEventListener() method attaches an event handler to the specified element. The addEventListener() method attaches an event handler to an element without overwriting existing event handlers. You can add many event handlers to one element. You can add many event handlers of the same type to one element, i.e two "click" events. You can add event listeners to any DOM object not only HTML elements. i.e the window object. The addEventListener() method makes it easier to control how the event reacts to bubbling. When using the addEventListener() method, the JavaScript is separated from the HTML markup, for better readability and allows you to add event listeners even when you do not control the HTML markup. You can easily remove an event listener by using the removeEventListener() method.
common events Event Description onchange - An HTML element has been changed onclick - The user clicks an HTML element 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 The addEventListener() method attaches an event handler to the specified element. The addEventListener() method attaches an event handler to an element without overwriting existing event handlers. You can add many event handlers to one element. You can add many event handlers of the same type to one element, i.e two "click" events. You can add event listeners to any DOM object not only HTML elements. i.e the window object. The addEventListener() method makes it easier to control how the event reacts to bubbling. When using the addEventListener() method, the JavaScript is separated from the HTML markup, for better readability and allows you to add event listeners even when you do not control the HTML markup. You can easily remove an event listener by using the removeEventListener() method.