点击验证码图片刷新验证码 js代码
<div class="phpcn-form-item"> <label class="phpcn-form-lable">验证码</label> <div class="phpcn-input-block"> <input type="text" class="phpcn-input" id="verifycode"> </div> <img src="/admins/account/captcha" id="captcha" style="border: 1px solid #cdcdcd;cursor:pointer;" onclick="reload_captcha()"> </div>
其中,为验证码图片生成地址
/admins/account/captcha
js代码如下
function reload_captcha(){ $('#captcha').attr('src','/admins/account/captcha?rand='+Math.random()); }
上一篇:PHP验证码类代码 功能比较齐全