开发者

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

Could someone tell me the difference bet开发者_运维知识库ween 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.


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)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜