Today I am going to talk about the common events that occur in a DOM. First of all what is an event?
_DOM events are signals that something has happened in the browser—like a user clicking a button, typing in a field, or scrolling the page. JavaScript can listen for these events and respond with custom behaviour.
_
These are the key aspects of a DOM event
- Event: A specific action (e.g. click, scroll, keydown, mouseover)
- Event Listener: A function that waits for an event and runs code when it happens
- Event Target: The element that triggered the event
- Event Object:Contains details about the event (e.g. mouse position, key pressed)
Some Form related events are :
submit: Form is submitted
change: Input value changes(after blur)
input:Input value changes (live)
focus:Element gains focus
blur: Elements loses focus
reset:Form is reset
So these are the commonly occuring DOM events and we can use these to make our webpage more enhancing and interactive.
Top comments (0)