Get clicked element using Javascript
===

I am adding a class to the clicked element and getting the innerHTML of it, if the clicked element is a container. But if it is a HTML element and not a container, 
For eg., if the clicked element is an image `<img src="hello.png" />`(which is not a container and cannot use innerHTML), then i need to get the corresponding element tag, i.e. i need to get `<img src="hello.png" />`. So anyway to do this with pure JavaScript? 

P.S. I don't want to use any JavaScript libraries here.