25 => Event Capturing, Bubbling, Propagation, and Once => No GitHub
.addEventListener
Event Capture:
Where you click is captured.
Capture DOWN. Run function on the way down.
Propagation: (Stop Propagation)
e.stopPropagation() —> stop bubbling event up
Bubbling: Run function on the way up.
It’s like nested clicking. Parent and child clicking. Tree and forest clicking. Ripples up to the top of the document. Starts deepest in the nest.
Once:
If set to true, will listen for a click and unbind itself. (div.removeEventListener).
EMPLOYERS: This is me sharing my successes - and failures - when learning something new.
.addEventListener
Event Capture:
Where you click is captured.
Capture DOWN. Run function on the way down.
Propagation: (Stop Propagation)
e.stopPropagation() —> stop bubbling event up
Bubbling: Run function on the way up.
It’s like nested clicking. Parent and child clicking. Tree and forest clicking. Ripples up to the top of the document. Starts deepest in the nest.
Once:
If set to true, will listen for a click and unbind itself. (div.removeEventListener).
EMPLOYERS: This is me sharing my successes - and failures - when learning something new.
Comments
Post a Comment