I”m attempting to write a little javascript function which will display an overlay with some text when an image is clicked on. I’ve created an array variable which holds the different text descriptions. the index should correspond to the image e.g. image 0 will correspond to the 1st item in the text array and so forth. how do i find out which child of the parent node “photoWrap” has been clicked on? if I know which child it is, I can use that as the index to the overlayText array – or do you have a better way of associating the image with the text?
The html is
the javascript is