Bug Tracker

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#8795 closed bug (invalid)

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)

Change History (2)

comment:1 Changed 9 years ago by timmywil

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/

comment:2 Changed 9 years ago by timmywil

Component: unfiledselector
Note: See TracTickets for help on using tickets.