How would I use Javascript to get the value of the options in this form selection?
I know I can use:
document.customerInfo.cardType.selectedIndex==4
but this wont work for me. I have over 30 and I really don’t wan to code that much. Is there anyway I can just get the value of the option?
<form id="teamSelect"><select name="team">
<option value="TEN">Tennessee</option>
<option value="GB">Green Bay</option>
</select>
<input type="button" value="submit" onclick="games();"/>
</form>
Add an ID to your select:
Then do
this will return
TEN,GB, etc.