I have an array say
x = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]
I am using javascript indexof() to check if an element exist or not in the array and if it doesn't exits to do something....
my problem is that when an element like, 1,2,3,4,5,6 doesn't exist in the array, it still judge elements like 10 for 1, 12 for 2, 13 for 3, 14 for 4, 15 for 5, 16 for 6. and so it will still return that the element exists eventhough it is not there
eg:
if x = [2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]
this will still not work as it will see 10 as 1
if(data1.indexOf(1)===-1){ document.getElementById("s1").style.backgroundColor= "red";
$("input[name='seat1']").attr("disabled", "disabled");
}
x.indexOf('[') == 0?1does not match10. please add the content ofdata1and/orx.