Bug Tracker

Modify

Ticket #3470 (closed bug: invalid)

Opened 5 years ago

Last modified 4 years ago

:not filters too many elements when used with '>' selector

Reported by: davcamer Owned by: flesler
Priority: major Milestone: 1.3
Component: selector Version: 1.2.6
Keywords: Cc:
Blocking: Blocked by:

Description

$(document).ready(function () {

$('tr > th').addClass('table-heading'); $('tr:not(tr > th)').addClass('highlight');

})

The second selector is flawed. The :not() shouldn't filter anything. Instead, it filters everything. .highlight is not added to any elements.

Not important for this particular example, but could be related to other problems like #2683

Change History

comment:1 Changed 5 years ago by choan

If you want to apply the "highlight" class to every TR which does not contains a TH, you're using a wrong selector.

Should be:

$('tr:not(:has(th))').addClass('highlight');

comment:2 Changed 4 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid
  • Component changed from unfilled to selector

Incorrect selector usage, per choan's comment.

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.