Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 7 years ago

#4421 closed bug (invalid)

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@…
Blocked by: Blocking:

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 (2)

comment:1 Changed 10 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 10 years ago by dmethvin

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.