js,检查关键字修改页面背景

//当修改非法内容后,红色背景变白色
function CheckTextForCpBrief()
{
   //关键字
var strTextValue = document.getElementsByClassName("BigText").item(0).value; var ok = true; for(var i=0;i<arrayContentAll.length;i++) { var strTmp = arrayContentAll[i]; if(strTextValue.indexOf(strTmp)!=-1){ ok = false; break; } } if(!ok){//如果有违规字符,页面是红色 theWin.document.bgColor = "FF0000" } else{ theWin.document.bgColor = "" } }

 

posted @ 2014-12-16 12:01  悉路  阅读(151)  评论(0)    收藏  举报