JS 判断是否包含的写法

var text = "abcdefg";   
  
if(text.indexOf("a") > 0 )   
{   
    alert("包含");   
}  

 

posted @ 2013-04-22 17:47  愤怒的牙签  阅读(427)  评论(0)    收藏  举报