I have a situation where an image tag is nested in an anchor tag set.
The anchor is assigned an id and is assigned a click/onclick event listener.
The anchor id corresponds to a list of objects in an array.
In practice, the image tag is receiving the event. The code does setAttribute in another elements img tag src attribute.
The image tag receiving the click event, (and passing it to the anchor tag)
is event.target. (or event.srcElement, in the case of I.E.)
What I want to know is how to reference the event.target
parent element, the anchor tag elements Id attribute.
sample anchor/img tag set:
I see the double slash in the img src path attribute. It is working as is
in test browser: Firefox ( so far)
This is in development stages. Later, I will assign the elements a css class
in my code, event.target.src has a usable value (src attribute of the img tag)
It does not have a usable value for event.target.id (id attribute of the anchor tag)
attribute defaults to a non scripted value.
Thank you for time and attention