i need to check a specific string exist in jquery array . For this i write the following code .But it is not working . Please help .
$(document).ready(function() {
var ar = ["color1:white", "color2:black"];
if ($.inArray("black", ar) > -1) {
alert("yes");
} else {
alert("no");
}
});
.I need to check black color is in the array. Please help.
jquery array
?.forEach()