http://blog.csdn.net/majian_1987/article/details/8586766 var arr = [ “xml”, “html”, “css”, “js” ]; $.inArray(“js”, arr); //返回 3, 如果不包含在数组中,则返回 -1;