Bug Tracker

Opened 10 years ago

Closed 10 years ago

#13617 closed bug (notabug)

On Safari, options with index>0 is selected twice times

Reported by: [email protected] Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.9.1
Keywords: Cc:
Blocked by: Blocking:

Description

on Safari, $("#selectMultiple option:selected") return selected options with index>0 two times : http://jsfiddle.net/jLC3d/

If we choose the first one it's ok but second and third are returned two times

"Work around" : $("#selectMultiple option").filter(function() { return $(this).is(":selected"); })

Change History (2)

comment:1 in reply to:  description Changed 10 years ago by [email protected]

It's about the non standard ID attribute set to the options Once we remove the ID or use a valid ID attribute on each options, it's ok

Replying to [email protected]:

on Safari, $("#selectMultiple option:selected") return selected options with index>0 two times : http://jsfiddle.net/jLC3d/

If we choose the first one it's ok but second and third are returned two times

"Work around" : $("#selectMultiple option").filter(function() { return $(this).is(":selected"); })

comment:2 Changed 10 years ago by mikesherov

Resolution: notabug
Status: newclosed

Thanks for contributing! As you note, your ids are invalid: http://stackoverflow.com/questions/70579/what-are-valid-values-for-the-id-attribute-in-html

As such, this is not a bug in jQuery.

Note: See TracTickets for help on using tickets.