Lopesilvero of LearningHouse Creatives
2/23/2017 - 7:49 PM

jQuery for removing all programs that are NOT the ones listed. NOTE: Keep the ':selected' value --- It is the option already selected on pa

jQuery for removing all programs that are NOT the ones listed.

NOTE: Keep the ':selected' value

It is the option already selected on page load and usually has text such as "Select a program". Without including ':selected', the default option shown on page load will be one of the programs which is unwanted.

// Values shown below are placeholders for the real ids.


$('#item_id option:not(:selected, [value="1111"], [value="2222"])').remove()