Switch statements are a way to avoid cumbersome multiple if-then-else constructs. In the above example we have to take 5 different actions depending on the 5 different values of the selected item. We can handle that by using something like
The copyright of the article
Drop Down Selection Lists in
JavaScript is owned by Muhammad Ali Shah. Permission to republish
Drop Down Selection Lists in print or online must be granted by the author in writing.