views:

41

answers:

4

I'm watching a tutorial learning JQuery for the first time, and it seems you can select items using pretty much CSS, like:

$('ul li:nth-child(3)').addClass('biscuits');

Is that kind of selector going to work on all browsers, or just ones that support CSS 3 ?

+1  A: 

It should work in all browsers - indeed, that is the main strength of jQuery :)

Geoff Adams
+2  A: 

It should work fine in all browsers JQuery actually supports.

Sarfraz
Thanks, this answers my question most accurately.
SLC
@SLC: You are welcome :)
Sarfraz
A: 

To my knowledge it works on all browsers that jQuery supports. Which is more than plenty. The technique here doesn't rely on CSS but on JavaScript.

Egor Kloos
A: 

It should work on all jQuery-supported browsers. It uses an internal selector engine to even out non-CSS3 browsers (cough, cough, IE). You shouldn't use a library though as it basically inhibits standards progress (and stems the flow of users away from IE).

Delan Azabani
and cough, cough FF 2.0
SztupY
Firefox 2.0 was bad, but think about chronologically. At the time, IE had IE6, which was a true abomination.
Delan Azabani
Re: “You shouldn't use a library though as it basically inhibits standards progress (and stems the flow of users away from IE).” Whilst I appreciate the point you’re making, that’s a pretty ridiculous position to take when faced with customer requirements.
Ben Poole
It depends on your audience. A business might require IE support, but a personal blog about web development (where you'd most likely like to make a point) mightn't.
Delan Azabani