JS实现过滤自定义关键字
<script language="JavaScript">
var myarray = new Array("关键字1","关键字2","关键字3");
function check(theForm) {
for (i=0;i<myarray.length;i++) {
if (theForm.name.value.indexOf(myarray[i])!=-1)
{alert("包含关键字");
return false;}
}
}
</script>
<form method="post" action="#">
<input value="" type="text" name="name">
<input type="submit" name="Submit" value="提交" onClick="return check(this.form)">
</form>
最近访问时间:2025-04-29 12:25:51