Last modified: 2014-08-25 12:01:03 UTC
For dynamic state always use properties. Attributes are for the DOM, not for the live display. Older versions of jQuery used to cover this common mistake by setting the property in addition to the attribute when setting the attribute, but this has all sorts of nasty side-effects. Use prop('selected', value) instead for this, and pass it a boolean true/false value (so not "" or "selected").
Change 156092 had a related patch set uploaded by Santhosh: Use prop instead of attr for changing 'selected' state https://gerrit.wikimedia.org/r/156092
Change 156092 merged by jenkins-bot: Use prop instead of attr for changing 'selected' state https://gerrit.wikimedia.org/r/156092