Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

Event are raised, and when they are raised they trigger a script.

When the click


event fires it could trigger a certain script. We have events like click, uncli
ck, mousedown, mouseup, and trigers like focus/focusin, blur, or any other. The
steps inovlved in getting the ode to trigger some JavaScript code is called even
t halding.
Selecing the element(s), indicate events to trigger the response, state the code
to run.
Three types of event handlers (HTML event handlers), do not use.
DOM event handlers
Event listeners
We can also use parameters.
Events can flow.
Event listereners methods attaches an event handler to a specific item.
Delegation of elements - creating event listeners for a lot of elements can slow
down a page, but event flow allows to listen for an event on a parent element.
preventDefault()
stopPropagation()
This keyword is the best was to determine which element the event occured on. If
we are using parameters, then this no longer works.
Some events are connected to the user interface. Like the load event.

You might also like