Give the select
an id
of roomType
and then use this
var e = document.getElementById("roomType");
var desiredValue = e.options[e.selectedIndex].value;
The value for options should be the desired data for your script. You should call the selectedIndex
of the select element rather than the options
, otherwise that would be a lot of code we would all have to type...no fun
<select name="roomType" id="roomType">
<option value="---">---------------------------</option>
<option value="5300">Ordinary</option>
<option value="SomePrice">Family</option>
<option value="SomePrice">Superior</option>
<option value="SomePrice">Deluxe</option>
<option value="SomePrice">Corner Suite King</option>
<option value="SomePrice">Executive</option>
<option value="SomePrice">Executive Suite</option>
<option value="SomePrice">Grand Executive</option>
<option value="SomePrice">Presidential</option>
</select>
Change SomePrice to your desired values.