Running into a roadblock with multiple variables and jquery if/then.
What I would like to do is when a user selects a specific state a calculation is done.
This is what I have so far but it is not working:
var zonea = ("NY", "NJ", "DE");
$('#states').change(function () {
var w = +$('#states').val();
if (w == zonea) {
alert("Good!");
}
})
If I change the code to:
var zonea = ("NY", "NJ", "DE");
$('#states').change(function () {
var w = +$('#states').val();
if (w = zonea) {
alert("Good!");
}
})
no matter what state I select the alert is shown.
Am not sure what I am doing wrong here.