Send the second parameter (this) to "onclick", which will be the image element itself
<img src="Icons/note_add.png" onclick="show('comment', this)"/>
then the function would apply "display none" to it:
function show(target, trigger){ document.getElementById(target).style.display = 'block'; trigger.style.display = "none" }
But all this is intrusive Javascript code, I would recommend using unobtrusive JS code.
source share