Could someone tell me the difference between those two. The first one is working on FF and not in IE (6) and second one is working in IE (6) and not in FF (I am using the Jquery 1.4.2). We had to detect the browser and write the script accordingly.
views:
68answers:
1
+7
A:
One has a descendant selector in the middle of it.
span:first
Will select "All span elements that the :first pseudo-class applies to"
span :first
Will select "All elements which have the :first pseudo-class applied to them AND which are descended from a span element"
There isn't actually a :first pseudo-class though. You might mean :first-child, :first-line or :first letter.
(Oh, :first
is some jQuery specific stuff, that explains why SelectOracle didn't know about it)
David Dorward
2010-05-13 13:11:48
Raja
2010-05-13 13:19:50
No, since (a) That would be a `<first-child>` element in a `<span>` etc and (b) `span:first-child` would be a span if it was the first child, not the first span. (You might want first-child, but it isn't what you had originally)
David Dorward
2010-05-13 13:48:37
yup got it thanks :-)
Raja
2010-05-13 13:50:30