Markup:
<div class="foo">
<img src="loading.gif" class="loading" style="display: none;" />
</div>
Js:
$("div[class='foo']").click(function(e) {
e.preventDefault();
$(this).hide();
$(/* somehow select the loading img of exactly this div with class foo (not others) */).show();
});