Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
In the JavaScript and the DOM course you practiced selecting elements. This will be helpful as selecting elements is the first step in watching for events. Once an element is selected, we can use a powerful method called addEventListener to listen for events, then make changes to that element or parts of the web page.
document.addEventListener('copy', (event) => {
alert('Please be sure to credit the author')
});
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
boi
14,242 PointsCan't sleep
Posted by boiboi
14,242 Points1 Answer
-
Samuel Kleos
Front End Web Development Techdegree Student 13,728 Points1 Answer
-
S C
5,947 PointsWhy is "event" passed into the anonymous function for the copy event example?
Posted by S CS C
5,947 Points1 Answer
-
PLUS
Joshua Munoz
Courses Plus Student 7,794 Points1 Answer
-
aarondesigndev
2,024 Points4 Answers
-
Jesse Gonzalez
7,322 Points3 Answers
-
Michael Rushton
7,126 Points1 Answer
-
LETITA BUZEA
Full Stack JavaScript Techdegree Student 4,247 Points2 Answers
-
judygrayland
8,647 Points1 Answer
-
Chris Adams
Front End Web Development Techdegree Graduate 29,423 Points2 Answers
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up