Use jQuery to select child element
Suppose you have the following structure:
<div class="section">
<h3 class="title">Title</h3>
<span class="description">…</span>
</div>
<div class="section">
<h3 class="title">Title</h3>
<span class="description">…</span>
</div>
This code will let you access the child elements of ‘.section’ when you use an ‘each’ function
<script type="text/javascript">
$(function(){
$(‘.section’).each(function(i,element){
$(‘description’,this).fadeOut(100).fadeIn(100).fadeOut(100).fadeIn(100).fadeOut(100).fadeIn(100);
});
});
</script>
I hope this helps someone, I kept forgetting how to do this, so this is mostly a reminder for myself.
Source: http://stackoverflow.com/questions/306583/jquery-this-selector-and-children/306904#306904
