I would like an event to fire whenever something other than a DOM element is clicked, and a separate event when an image is clicked.
Right now I have:
$( document ).click( function() { /*do whatev*/ } );
and in another place:
$( "img" ).click( function( e ) {
e.stopPropagation();
/*do whatev*/
} );
it does not work. both events are fired. any other ideas?
Simple and concise:
If the user clicks on an img element ‘img’ is alerted, otherwise the click event is stopped.