I have been struggling to figure out why my code is not working properly. I am working on a browser implementation of the game minesweeper, and am trying to get an image to hide() when the element is clicked. My html is as follows...
<img id="61" class="reveal" width="30px" height="30px" style="position:absolute;" src="img/tile.ico">
and my jquery looks like this...
$( document ).ready(function() {
$(".reveal").click(function(){
$(this).attr("id").hide();
});
});
The problem seems to be my trying to grab the element id using $(this).attr("id").