var arr = [ "xml", "html", "css", "js" ]; $.inArray("js", arr); //返回 3,如果不包含在数组中,则返回 -1; 转载于:https://www.cnblogs.com/dragon-L/p/4616104.html