Thanks guys! Paul's http://docs.jquery.com/Selectors/nthChild suggestion is perfect as the lists are generated dynamically I can not add id's to each item.
On Jul 2, 11:14 am, Shiro <nimro...@gmail.com> wrote: > Perhaps give each of them an ID? for example: > > <ul> > <li>one</li> > <li>two</li> > ............... > <li id="fifth">fifth</li> > <li id="sixth">sixth</li> > </ul> > > Then you can target them by: > > $("#fifth") in jquery OR > > #fifth { > > } > > in CSS > > On Jul 1, 6:10 pm, Wacko Jacko <jackson.be...@gmail.com> wrote: > > > How would I target (with jQuery or normal javascript) the 5th and 6th > > li in an unsorted list for styling? I need to change the css for only > > 2 items in a list. > > > Thanks in advance for your help.