This HTML5 document contains 9 embedded RDF statements represented using HTML+Microdata notation.

The embedded RDF content will be recognized by any processor of HTML5 Microdata.

PrefixNamespace IRI
foafhttp://xmlns.com/foaf/0.1/
n4http://ods-qa.openlinksw.com:8896/about/id/entity/https/discourse.mozilla.org/t/image-gallery-assessment/
n7https://discourse.mozilla.org/t/image-gallery-assessment/
pwdrhttp://www.w3.org/2007/05/powder-s#
schemahttp://schema.org/
rdfshttp://www.w3.org/2000/01/rdf-schema#
rdfhttp://www.w3.org/1999/02/22-rdf-syntax-ns#
n2http://ods-qa.openlinksw.com:8896/proxy-iri/
n10http://ods-qa.openlinksw.com:8896/about/id/https/discourse.mozilla.org/t/image-gallery-assessment/
xsdhhttp://www.w3.org/2001/XMLSchema#
siochttp://rdfs.org/sioc/ns#
Subject Item
n7:24687
foaf:topic
n2:b808712d6dc0cae1aa79b38a930e1f90e3580307
Subject Item
n4:24687
sioc:container_of
n2:b808712d6dc0cae1aa79b38a930e1f90e3580307
Subject Item
n2:b808712d6dc0cae1aa79b38a930e1f90e3580307
rdf:type
rdf:Statement
rdfs:label
Embedded HTML5 Microdata Statement 56
pwdr:describedby
n4:24687 n10:24687
rdf:object
I’m a little confused on how event objects work. In my for loop the following code works: for (i = 1; i <= 5; i++) { var newImage = document.createElement('img'); newImage.setAttribute('src', "images\/pic" + i + ".jpg"); thumbBar.appendChild(newImage); function displayThumb(clickedImage) { var imageThumb = clickedImage.target.getAttribute('src'); displayedImage.setAttribute('src', imageThumb); }; newImage.addEventListener('click', displayThumb); } While the following does not work: for (i = 1; i <= 5; i++) { var newImage = document.createElement('img'); newImage.setAttribute('src', "images\/pic" + i + ".jpg"); thumbBar.appendChild(newImage); function displayThumb(clickedImage) { var imageThumb = newImage.getAttribute('src'); displayedImage.setAttribute('src', imageThumb); }; newImage.addEventListener('click', displayThumb); } In other words, what is the event object in the displayThumb function doing in the first example that allows it to be functioning on the entire loop, whereas in the second example the loop is completed, and the click events only function on the last thumbnail.
rdf:predicate
schema:articleBody
rdf:subject
n2:296851322ef22bdfcb5f617eac608d67c2f22867