I want to ask a question why this is not working?
var a = $('input').attr('value').split(',');
if(a instanceof Array) alert(1);
if($.inArray($('#id').text(), a)) alert(2);
if($.inArray('United State', a)) alert(3);
// a is array but no return correct match.
I split a value into array and use $.inArray to check where a string has in the array.
But it will not return correct index.
I dont know what is wrong in the example. Please advice.
Thank you very much.