Why am I getting 'undefined' when evaluating the value of a select element?
I'm using this code to try to retrieve the value of a select element (which contains 1..10):
-
'change #date1Shift1JobLoc1Count': function(event) {
var d1s1jl1Count = $('date1Shift1JobLoc1Count').val();
if (d1s1jl1Count > 1) {
$('date1Shift1Worker5').removeClass('hide');
} else {
$('date1Shift1Worker5').addClass('hide');
}
}
...but, after selecting the "2" option, the value of d1s1jl1Count is 'undefined'.
Why?