Reputation: 19
I want to check if my array contains the Value Input, i want something like that, anyone have an idea on how to do that ?
if(jQuery.inArray($('#ValueInputTitle').val, variableValueInput) !== -1)
{
console.log("is in array");}
else {
console.log("is NOT in array");
}
Upvotes: -3
Views: 437
Reputation: 2157
You can use this,
if(jQuery.inArray($('#ValueInputTitle').val(), variableValueInput) !== -1)
{
console.log("is in array");}
else {
console.log("is NOT in array");
}
Upvotes: 1