Mind has gone blank this afternoon and can\'t for the life of me figure out the right way to do this:
if(i!=\"3\" && i!=\"4\" && i!=\"5\" &&a
This solution is cross-browser:
var valid = true; var cantbe = [3, 4, 5]; // Fill in all your values for (var j in cantbe) if (typeof cantbe[j] === "number" && i == cantbe[j]){ valid = false; break; }
valid will be true if i isn't a 'bad' value, false otherwise.
valid
true
i
false