JS 检测字符串是否还有某个字符

function filer(s)
{
     var str = "字符串";  
    if (str.indexOf(s) == -1) {  
        alert("没有");  
    } else {  
        alert("有");  
    }    
}

 

posted @ 2017-11-15 13:20  LBO.net  阅读(174)  评论(0编辑  收藏  举报
//返回顶部