Bug Tracker

Modify

Ticket #9458 (closed bug: invalid)

Opened 2 years ago

Last modified 2 years ago

:not() selector problem?

Reported by: johnfirth2@… Owned by:
Priority: undecided Milestone: 1.next
Component: unfiled Version: 1.6.1
Keywords: Cc:
Blocking: Blocked by:

Description

With regard to this  http://stackoverflow.com/questions/1730609/using-jquery-not-selector-to-exclude-elements-with-particular-children/6157579#6157579

the first suggestion in Russ Cam's post, i.e:

$("div.divToAppendTo:not(div > span.myAppendedMarkup)")

doesn't seem to work. It selects all the divs rather than just those without the span child. I don't, however, understand why it doesn't work, so I'm raising it as a possible bug.

Hope I'm not wasting your time.

Change History

comment:2 Changed 2 years ago by dcherman

From what I can see, the reason the provided suggestion doesn't seem to work is that the selector in the :not selects all of the span elements with the given class rather than the parent DIV

 http://api.jquery.com/child-selector/

comment:3 Changed 2 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid

In the first you're *selecting* the span, which does not match any div.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.