Created
March 16, 2022 12:29
-
-
Save zahra-ove/9e8e34b2acc644017102109546784af0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
in js: | |
function makeDoggy(e) { | |
e.target.setAttribute('src', 'https://content.codecademy.com/courses/React/react_photo-puppy.jpeg'); | |
e.target.setAttribute('alt', 'doggy'); | |
} | |
in html: | |
<img | |
src="https://content.codecademy.com/courses/React/react_photo-kitty.jpg" | |
alt="kitty" | |
onclick="makeDoggy()" /> | |
==================================================================================== |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment