When use onclick and when not

a click event listener attached to the body of the page and then work out what was clicked from within the function the click event listener calls