Child elements can be selected in jQuery, the same as you would select them with CSS. Simply put a space between the parent and the child.
So if you wanted to select paragraphs that are within a div with an id of content, you would have a selector like the following:
$('#content p')
Likewise you can also use the children function, although I don’t see a need for it in most circumstances. It would be used as:
$('#content').children('p')
The children function’s parameter is optional. If no parameter is passed, to filter out elements, then all of the children for that selected element are selected.
Chaining
You can chain functions in jQuery. Which basically means that if you put a period between functions, you can additional add CSS, classes, or any other jQuery function after the children. This is somethign that makes jquery a unique.
$('#content').children('li').css('background-color', '#ddd');
Working with Child Elements was originally found on Access 2 Learn