/ Published in: JavaScript
this function tells you whether or not the passed value is in the passed array
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function isValueInArray(arr, val) { inArray = false; for (i = 0; i < arr.length; i++) if (val == arr[i]) inArray = true; return inArray; }