I was just about to set onclick event for my element in javascript, but I wonder which of these two options is more efficient:
document.getElementById(myid).onclick = function(e){...}
or
document.body.onclick = function(e){if(e.target.id == myid)...}
Is there any difference? Is one of these declarations processed slower?