Matching a value to JSON array values in jquery
- by chrism
I have a JSON array that looks like this:
['Monkey','Cheetah','Elephant','Lizard','Spider']
I also have a text input. I want to test whether the value of the input upon 'blur' is also in the array and if it is do something.
Knowing a bit of python I tried something like this:
var existing_animals =…