What is the meaning of the character(~) in jquery or css selector?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • oranoos3000
    New Member
    • Jan 2009
    • 107

    What is the meaning of the character(~) in jquery or css selector?

    hi

    would you please help me , what is meaning of the below jquery statement
    Code:
    $('~ span:first',this).text();
    i dont understand meaning of the ~ in jquery selector


    thanks very much for all your trouble
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    that’s the CSS3 selector for a (general) sibling (cf.)

    Comment

    • JKing
      Recognized Expert Top Contributor
      • Jun 2007
      • 1206

      #3
      ~ is the next siblings selector. It will select all siblings matching the filter provided. In this case the filter is span:first.

      Have a look at the jquery api docs for a more detailed explanation.

      jquery api ~

      Comment

      Working...