Skip to main content

Bug Tracker

Side navigation

#13617 closed bug (notabug)

Opened March 16, 2013 12:18PM UTC

Closed March 16, 2013 01:32PM UTC

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

Reported by: leakim@wanadoo.fr 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"); })

Attachments (0)
Change History (2)

Changed March 16, 2013 12:34PM UTC by leakim@wanadoo.fr comment:1

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 [ticket:13617 leakim@…]:

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"); })

Changed March 16, 2013 01:32PM UTC by mikesherov comment:2

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.