Bug Tracker

Modify

Ticket #4421 (closed bug: invalid)

Opened 4 years ago

Last modified 14 months ago

jQuery.filter() and jQuery.find() do not return select or option elements.

Reported by: dancasper Owned by: john
Priority: major Milestone: 1.4
Component: selector Version: 1.3.2
Keywords: select option filter find Cc: dancasper@…
Blocking: Blocked by:

Description

I am attempting to retrieve all 'form' elements from a div with varying levels of descendants. The following returns all child elements:

$('#Settings').find('*')

OUTPUT: [div#Device, span, table, tbody, tr, td, td, input, td, input Update, td, input Clear, tr, td, td, input, td, input Browse ..., tr, td, td, input, tr, td, td, input, td, input Browse ..., tr, td, td, input on, tr, td, td, input on, div#Options, span, br, table, tbody, tr, td, td, input, td, input Format ..., tr, td, td, select, option, option, option, tr, td, td, input on, tr, td, td, input, td, input Format ..., td, input Clear]

The select and option elements are clearly available. If I attempt to find specific elements instead, I get everything except the Select and Option elements:

$('#Settings').find('*').filter('input','select','textarea','option');

OUTPUT: [input, input Update, input Clear, input, input Browse ..., input, input, input Browse ..., input on, input on, input, input Format ..., input on, input, input Format ..., input Clear]

Also

$('#Settings').find('input','select','textarea','option');

OUTPUT: [input, input Update, input Clear, input, input Browse ..., input, input, input Browse ..., input on, input on, input, input Format ..., input on, input, input Format ..., input Clear]

Again, everything is in the return set except the select and option elements. Please advise,

Change History

comment:1 Changed 4 years ago by dancasper

This issue can be closed. I had improper syntax in the find/filter expression. This function call returns the expected values:

$('#Settings').find('input,select,option,textarea');

Many apologies.

comment:2 Changed 4 years ago by dmethvin

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

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.