Whats the equivalent of the below jquery code using javascript?
$("#id").on("click",function(event){alert(event.target.id);});
I know i can use the below code
document.addEventListener('click', function(e) { alert(e.target.id) }, false);
But i want to constrain it to a particular id and not the whole document.