Hi RG,

Try $('ul li:first-child') instead. that should do it.

http://docs.jquery.com/Selectors/firstChild

Cheers,

--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Feb 20, 2008, at 7:40 PM, RG wrote:


I have a feeling this is easy, but I can't seem to wrap my head around
it.  I want to match the first item of multiple lists.  For example
below, I would like a set with the "foo 1" and "bar 1" items . Can I
get this using one match?  My  tries keep coming back to something
like $('ul li:first'), but that only matches "foo 1" of course.
Thanks for any help!

<ul>
 <li>foo 1</li>
 <li>foo 2</li>
 <li>foo 3</li>
</ul>

<ul>
 <li>bar 1</li>
 <li>bar 2</li>
 <li>bar 3</li>
</ul>

Reply via email to