The HTML:
<div class="first" id="first_id">
<div class="second">text sample</div>
<div class="third"><button type="submit" class="some_class" id="some_id">send</button></div>
</div>
Jquery:
$("#some_id").click(function() {
var test = $(this).closest('.first').attr('id');
..
return false;
});
I want to replace content of the "first" div using var "test" in jquery code above. Something like:
$("."+test).html('<img src="img/spin.gif">');
But when I put this part of the code in function above it does not work. What I did wrong?