Skip to main content

Bug Tracker

Side navigation

#8795 closed bug (invalid)

Opened April 07, 2011 01:35AM UTC

Closed April 07, 2011 01:59PM UTC

Last modified April 07, 2011 02:39PM UTC

Specific Selector doesn't work in IE 6, 7, or 8

Reported by: anonymous Owned by:
Priority: undecided Milestone: 1.next
Component: selector Version: 1.5.1
Keywords: Cc:
Blocked by: Blocking:
Description

Example:

http://jsfiddle.net/5WLWq/

<div id="field_option">
<select name="item_1">
<option value="1" selected>1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</div>

<div id="field_option">
<select name="item_2">
<option value="1" selected>1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</div>

performing:

alert($('#field_option select [value="1"]').filter(':selected').length)

returns fine on firefox, chrome, and safari (should alert 2)

but no luck on IE 6, 7 (alerts 1)

my work-around was to set a class to each select and calling it like so:

$('.field_option_select [value="1"]').filter(':selected').length

which worked perfectly

another user suggested *[value="1"] instead, which still doesn't work except in 8 (i assume 9 as well, but never tried)

Attachments (0)
Change History (2)

Changed April 07, 2011 01:59PM UTC by timmywil comment:1

resolution: → invalid
status: newclosed

Thank you for submitting a bug report to the jQuery bug tracker. It seems your html is invalid. IDs should be unique. http://jsfiddle.net/5WLWq/3/

Changed April 07, 2011 02:39PM UTC by timmywil comment:2

component: unfiledselector