var arr = [ "xml", "html", "css", "js" ]; $.inArray("js", arr); //返回 3, $.inArray("php", arr); // 如果不包含在数组中,则返回 -1; 即返回下标