jQuery: select first and/or last list items


/ Published in: jQuery
Save to your folder(s)

Select the first and last item in an unordered list. As an example, I add a CSS class to each.

In WordPress, it's not so easy to get wp\_list\_pages() to generate these classes. jQuery provides an easy out for javascript-enabled clients.

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.