Bug Tracker

Modify

Ticket #8795 (closed bug: invalid)

Opened 2 years ago

Last modified 2 years ago

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

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

comment:1 Changed 2 years ago by timmywil

  • Status changed from new to closed
  • Resolution set to invalid

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 2 years ago by timmywil

  • Component changed from unfiled to selector

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.