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:
<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)
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/