An Interest In:
Web News this Week
- April 2, 2024
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
- March 27, 2024
January 14, 2022 05:18 am GMT
Original Link: https://dev.to/jennifer_tieu/self-taught-developer-journal-day-38-top-dom-manipulations-and-events-cont-3i9b
Self-Taught Developer Journal, Day 38: TOP DOM Manipulations and Events cont.
Today....
Exercises
- an h3 with blue text that says Im a blue h3!
- a div with a black border and pink background color with the following elements inside of it:
- another h1 that says Im in a div
- a p that says ME TOO!
- Hint for this one: after creating the div with createElement, append the h1 and p to it before adding it to the container.
Events
Events are actions that occur on the web page like a mouse click or a key press. With JavaScript, we can listen to the events on the web page and react to them.
The three primary methods are:
Examples taken from The Odin Project
Method 3, Attach event listeners to the nodes in your JavaScript, is the preferred method. It maintains separation of concerns and multiple event listeners can be added.
Resources
Original Link: https://dev.to/jennifer_tieu/self-taught-developer-journal-day-38-top-dom-manipulations-and-events-cont-3i9b
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To