I have a javascript file that sets an EventListener of \'click\' on every element with the tag. I want to get the id of the article clicked when
articles.addEventListener('click',redirect,false); // omit redirect(e) inside event listener // and then try with the alert as you did.
if does not work then try by e.id instead of e.target.id inside alert as below:
alert(this.id);
Thanks.