I have two related dropdowns.
When the user selects an option from the first drop down, the second drop down is populated with a list of all the options from the first drop down that were NOT selected.
I’m trying to use jquery to get all the not selected options, but I’m still a jquery newb and must be mising something.
I am trying the following:
$('#segmentCrossStreet1:not(:selected)')
This is where “segmentCrossStreet1” is the ID of the first drop down. This doesn’t appear to return anything useful. What am I doing wrong?
Fiddle: http://jsfiddle.net/uzhWS/ (this fiddle also shows how to pupulate another
<select>)You have to select the
<option>elements, rather than the “selected<select>” elements: