JS实现验证码局部更新

JS页面
var checkcode=document.getElementById("checkcode");
checkcode.onclick=function(){
this.src='checkcode.php?tm='+Math.random(); //实现验证码局部刷新 checkcode.php为验证码文件
}

HTML应用验证码页面
<dd>验 证 码:<input type="text" name="checkCode" /><img src="checkcode.php" id="checkcode" alt="刷新"></img></dd>

posted @ 2013-06-24 21:14  罗导  阅读(355)  评论(0编辑  收藏  举报