Skip to content

Instantly share code, notes, and snippets.

@17

17/demo.js Secret

Created April 14, 2018 11:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 17/7930e51a16c4139be010408861023175 to your computer and use it in GitHub Desktop.
Save 17/7930e51a16c4139be010408861023175 to your computer and use it in GitHub Desktop.
document.getElementById("movielist").addEventListener("click", function(event) {
var target = event.target
if (target.nodeName.toLocaleLowerCase() == "a") {
var source = target.getAttribute("href")
var placeholder = document.getElementById("placeholder");
placeholder.setAttribute("src", source)
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment