Hi guys.

I'm very new to Javascript although I have done a fair amount of PHP. The two languages seem to be sufficiently different or I'm doing something wrong to ask this question.

What is the best way to get the value of an option, then act on it according to the value in the option.

For example if I have

  • Apple
  • Banana
  • Orange


How do I get the script to do something with oranges?

Do I use Switch or a series of If/Elseif statements?

Also should I use the value tag for options as having spaces would cause issues wouldn't they?

Code:
<select>
<option value="fruitApple">Apples are nice</option>
<option value="fruitBanana">Bananas are nice</option>
<option value="fruitOrange">Oranges are nice</option> 
</select>
If this is the case then how do you select the value?

Thanks for your help folks.