Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will unsupported selectors for CSS work when used inside jQuery?

There are several CSS selectors that are not supported by IE6 example:

> (Child selector)
+ (Selects an element that is a next sibling of another element.)
[attr] selector
:first-child

Does this impact the functioning of jQuery? i.e. if you use eg :

$("div > a").css("","");

Will it cause problems in IE6 or will it work without issues. Basically my question is, in its core does jQuery rely on the browser or does it use its own logic to select DOM elements.

I know everyone hates IE6 and you probably feel it should not be supported, but, I am trying to understand how jQuery actually works under the hood.

Thanks!

like image 216
DMin Avatar asked Sep 03 '10 08:09

DMin


1 Answers

jQuery selectors are implemented with the Sizzle Selector engine, which is compatible with:

Fire­fox 2.0+, Inter­net Explorer 6+, Safari 3+, Opera 9+, Chrome 1+

http://www.kevinleary.net/enhancing-css-with-javascript-using-sizzle/

like image 161
pharalia Avatar answered Nov 15 '22 05:11

pharalia