var idx = $.inArray(sub_menu[j].id, Valid_Oper_Id) code example Example: jquery check if value is in array $.inArray( 5 + 5, [ "8", "9", "10", 10 + "" ] );