Reputation: 187
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
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