Skip to content

Instantly share code, notes, and snippets.

@benedmunds
Forked from anonymous/Result
Created April 11, 2014 19:55
Show Gist options
  • Save benedmunds/10496607 to your computer and use it in GitHub Desktop.
Save benedmunds/10496607 to your computer and use it in GitHub Desktop.
<div class="foo bar"></div>
<div class="foo raa"></div>
<ul id="container">
<li>
<div class="foo bar"></div>
<div class="foo bar"></div>
<div class="foo bar"></div>
</li>
<li>
<div class="foo raa"></div>
<div class="foo raa"></div>
<div class="foo raa"></div>
</li>
</ul>
<script>
$(document).ready(function(){
$('ul#container li').each(function(){
$(this).find('.foo').hide();
$(this).find('.foo:first').show();
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment