option:checked, not [selected].

Just a quick note.  I’m not sure if this is just me, but until recently I’ve only interacted with the option element by checking for a [selected] attribute.  This caused me no end of problems when dealing with the excellent bootstrap-select library.

Once the element is loaded into the DOM, the [selected] attribute is not how you need to check the state of an option, or query for options.  To query for options which have been selected by the user, use the :checked pseudo-class selector, just as you would with a radio or checkbox input.