check in array jquery code example
Example 1: jquery check value exists in array
if ($.inArray('example', myArray) != -1)
{
// found it
}
Example 2: jquery in array
function isInArray(value, array) {
return array.indexOf(value) > -1;
}
Example 3: jquery check if value is in array
$.inArray( 5 + 5, [ "8", "9", "10", 10 + "" ] );