Friday, September 28, 2012

Plain-Jane JavaScript way to get the value of a dropdown list and the value of a hidden field

var foo = document.getElementById('Bar');
var baz = document.getElementById('Qux');
alert(foo.options[foo.selectedIndex].value);
alert(baz.value);

No comments:

Post a Comment