I have the following HTML:
<div class="alert-message success">
<a class="close" style="display: none; ">×</a>
<p>Authenticated as Zach.</p>
</div>
And the following jQuery:
$('.close').click(function(){
$('.alert-message success').hide('slow');
});
Is there something fundamentally wrong about hiding a <div>? If I hide .close instead, there is no problem. I’m not sure why this isn’t working though.
It needs to be:
With
$('.alert-message success'), you’re asking JQuery to look for a div class.successinside a separate div classalert-message.