removing all options of select box except 1st option

I’m trying to empty select options when:

id “mClick” is selected, id’s “sClick”, “cClick” & “srClick” will be emptied.

id “sClick” is selected, id’s “cClick” & “srClick” will be emptied.

id “cClick” is selected, id “srClick” will be emptied.

in scenario 3, i used this function, yet it deleted all, except the last select. Any idea’s what i’m missing? Thanks

The easiest way to clear the options in the way you’re describing is by using options.length = 1. Also, you can leverage the fact that each drop down clears the ones that logically follow it, so that you only need to declare a single alter handler.

Demo

I’m not sure how you’re going to repopulate the drop downs though 🙂