Skip to main content

Bug Tracker

Side navigation

#4421 closed bug (invalid)

Opened March 25, 2009 05:50PM UTC

Closed March 26, 2009 02:09AM UTC

Last modified March 15, 2012 02:15PM UTC

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@gmail.com
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,

Attachments (0)
Change History (2)

Changed March 25, 2009 06:01PM UTC by dancasper comment:1

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.

Changed March 26, 2009 02:09AM UTC by dmethvin comment:2

resolution: → invalid
status: newclosed