JS 检测字符串是否还有某个字符 function filer(s) { var str = "字符串"; if (str.indexOf(s) == -1) { alert("没有"); } else { alert("有"); } }