Last active
October 28, 2019 15:43
-
-
Save jcupitt/5ff60adc3a9bf61a22ee184d9636bdee to your computer and use it in GitHub Desktop.
attach a handler
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>HELLO GOOBLERAMPLING</title> | |
</head> | |
<body> | |
<a href="viewerPage.html" target="_blank" id="myPicture"> | |
<img src="thePic.png"> | |
</a> | |
<script> | |
document | |
.getElementById("myPicture") | |
.addEventListener("click", function() { | |
var thisPic = this.getElementsByTagName("img")[0].src; | |
console.log("thisPic = " + thisPic); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment