Getting a drop down box value with javascript?
Posted
by
ritch
on Stack Overflow
See other posts from Stack Overflow
or by ritch
Published on 2011-11-26T17:35:16Z
Indexed on
2011/11/26
17:50 UTC
Read the original article
Hit count: 170
I'm trying to get the value currently selected and I simply want to alert it.
I current have this:
<script type="text/javascript">
alert(forms.elements('sets').value);
</script>
HTML:
<form>
<select name="sets">
<option value="1">1 Set</option>
<option value="2">2 Sets</option>
<option value="F">3 Sets</option>
</select>
</form>
© Stack Overflow or respective owner