Is there a difference between "span: first" and "span: first" in JQuery Selectors?

Can anyone tell me the difference between the two. The first one works on FF, not IE (6), and the second one works on IE (6), not FF (I am using JQuery 1.4.2). We had to discover the browser and write the script accordingly.

+2


a source to share


1 answer


One has a descendant selector in the middle.

span:first

      

Will select "All span elements that: the first pseudo-class belongs to"

span :first

      



Selects "All elements that have: the first pseudo-class applied to them AND that derive from a span element"

However, not really: the first pseudo-class. You could mean: first-child ,: first-line, or: first letter.

(Oh :first

- this is jQuery specific stuff that explains why SelectOracle didn't know about this)

+7


a source







All Articles