Pages
Home
Java
Android
Php
Cake PHP
jQuery
Grails
All Pages
Friday, March 1, 2013
How to find if an array contains a specific string in JavaScript/jQuery?
var cat = [];
cat.push('1');
cat.push('2');
cat.push('3');
var
found
=
$
.
inArray
(
'1'
,
cat
)
>
-
1
;
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment