Bug Tracker

Modify

Ticket #5550 (closed bug: invalid)

Opened 4 years ago

Last modified 3 years ago

Selector option:gt(-1) doesn't work for Select fields

Reported by: caseol Owned by: john
Priority: major Milestone: 1.4
Component: selector Version: 1.3.2
Keywords: Cc:
Blocking: Blocked by:

Description

I was trying to empty all options of a select field doing:

$("#MySelectFieldId option:gt(-1)").remove();

Using jQuery 1.3.2 it doesn't work, but using 1.2.6 does.

So, I check the size of the array returned: $("#MySelectFieldId option:gt(-1)").size() and the result is 0 no matter the number of options inside the select field.

Hope it could help.

Regards

Change History

comment:1 Changed 3 years ago by snover

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

This selector makes no sense. If you want to select everything, omit the :gt.

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.