如何通过单击刷新图片验证码?

来源:互联网 发布:数据库读取慢怎么解决 编辑:程序博客网 时间:2024/06/10 00:14

通过单击刷新图片验证码,可对图片绑定onclick事件处理程序。代码如下:

<input name="txtCheckCode" type="text" class="fixedWidth" id="txtCheckCode" />

<img src="code.jsp" alt="验证码" height="20" align="bottom" style="cursor:pointer;" title="看不清可单击图片刷新" onclick="this.src='code.jsp?d='+Math.random();" />

转载http://blog.sina.com.cn/s/blog_53729e460100ppib.html