Menu
I have this JS code which works perfectly for content which is loaded dynamically and it the element I want is a single element.
However if it’s a hyperlink for example, or even a parent DIV how can I get this and not the IMG, SPAN or I tag?
[code]
<a href=”#” id=”homeLink”>
<img src=”…” alt=”…”>
<span>This is some text</span>
<i class=”font-awesome-font”>
</a>
[code]
document.addEventListener(‘click’,function(e){
console.log(‘click’, e.target);
if(e.target && e.target.id == “homeLink”){
myFunction();
}
})
I really don’t want plug in’s like jQuery etc