hs19
hs19

Reputation: 187

Why we use jQuery selector with colon?

I was recently going through a jquery code where they had used 'div:#idname' as selector. What is the use of this selector with colon?

here is the link to js file

http://www.amitpatil.me/demos/twitter-like-topwtweets/js/toptweet.jquery.js

Upvotes: 0

Views: 442

Answers (1)

T.J. Crowder
T.J. Crowder

Reputation: 1074919

There is none in that example; it's an invalid selector.

The colon is used to introduce various pseudo-classes like state pseudo-classes (:hover, :active, etc.), structural ones (:nth-child, etc.). Two colons are used to introduce pseudo elements like ::before and such, but div:#idname is invalid.

Upvotes: 1

Related Questions