Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
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 upRelated 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