If someone clicks on a link within a div with the class "foo" I want the list items within this div to show. How can I do this?
Here's my failed attempt:
$('div > li').hide();
$('div.foo > a').click(function(event) {
$('div.foo > li').show();
event.preventDefault();
});
<ul>
<div class="foo">
<a href="#">Animals +</a>
<li>Cat</li>
<li>Dog</li>
<li>Rabbit</li>
</div>
</ul>