0% found this document useful (0 votes)
3 views

c10frontend

great notes for js

Uploaded by

Sahil Narang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

c10frontend

great notes for js

Uploaded by

Sahil Narang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

List of JavaScript Events with Explanations

Mouse Events
• click: Fired when an element is clicked.
• dblclick: Fired when an element is double-clicked.
• mousedown: Fired when the mouse button is pressed down.
• mouseup: Fired when the mouse button is released.
• mousemove: Fired when the mouse is moved over an element.
• mouseenter: Fired when the mouse enters an element (does not bubble).
• mouseleave: Fired when the mouse leaves an element (does not bubble).
• mouseover: Fired when the mouse moves over an element or its child.
• mouseout: Fired when the mouse moves out of an element or its child.
• contextmenu: Fired when the right mouse button is clicked (to open a context menu).

Keyboard Events
• keydown: Fired when a key is pressed down.
• keyup: Fired when a key is released.
• keypress (deprecated): Similar to 'keydown', but does not detect all keys (e.g., arrow
keys).

Form Events
• submit: Fired when a form is submitted.
• change: Fired when the value of an input, select, or textarea changes.
• input: Fired when the value of an input element is modified.
• focus (does not bubble): Fired when an element gains focus.
• blur (does not bubble): Fired when an element loses focus.
• reset: Fired when a form is reset.
• select: Fired when text is selected in an input or textarea.

Window and Document Events


• load: Fired when the entire page (including images) is fully loaded.
• DOMContentLoaded: Fired when the DOM is fully loaded, without waiting for images or
stylesheets.
• resize: Fired when the window is resized.
• scroll: Fired when the user scrolls in the document or a specific element.
• unload (deprecated): Fired when the document or a resource is being unloaded.
• beforeunload: Fired before a user leaves the page (allows confirmation dialogs in some
browsers).

Clipboard Events
• copy: Fired when the user copies content.
• cut: Fired when the user cuts content.
• paste: Fired when the user pastes content.

Drag and Drop Events


• drag: Fired when an element is being dragged.
• dragstart: Fired when the user starts dragging an element.
• dragend: Fired when the user stops dragging an element.
• dragover: Fired when a dragged element is over a valid drop target.
• dragenter: Fired when a dragged element enters a valid drop target.
• dragleave: Fired when a dragged element leaves a valid drop target.
• drop: Fired when a dragged element is dropped.

Touch Events (for mobile devices)


• touchstart: Fired when a touch point is placed on the screen.
• touchmove: Fired when a touch point moves across the screen.
• touchend: Fired when a touch point is removed from the screen.
• touchcancel: Fired when a touch is interrupted (e.g., by an incoming call).

Media Events
• play: Fired when media playback starts.
• pause: Fired when media playback is paused.
• ended: Fired when media playback ends.
• volumechange: Fired when the volume changes.
• timeupdate: Fired when the media playback position changes.
• seeked: Fired when a user completes seeking (jumping to a new position).
• seeking: Fired when a user starts seeking.

Focus and Blur Events


• focusin (bubbles): Fired when an element or its child gains focus.
• focusout (bubbles): Fired when an element or its child loses focus.

Animation Events
• animationstart: Fired when a CSS animation starts.
• animationend: Fired when a CSS animation ends.
• animationiteration: Fired when a CSS animation completes an iteration.

Transition Events
• transitionstart: Fired when a CSS transition starts.
• transitionend: Fired when a CSS transition ends.
• transitioncancel: Fired when a CSS transition is canceled.

Miscellaneous Events
• error: Fired when an error occurs (e.g., in loading resources like images or scripts).
• abort: Fired when a resource load is aborted (e.g., image loading canceled).
• wheel: Fired when the user scrolls using a mouse wheel.
• pointerdown: Fired when a pointer (mouse, pen, or touch) makes contact.
• pointerup: Fired when a pointer is lifted.
• pointermove: Fired when a pointer moves.
• pointerenter: Fired when a pointer enters an element.
• pointerleave: Fired when a pointer leaves an element.

Custom Events
• Custom events: Custom events can be created using the CustomEvent constructor.

You might also like