时间:2021-07-01 10:21:17 帮助过:1人阅读
本文实例为大家分享了Javascript实现验证码的具体代码,供大家参考,具体内容如下
1、一个简单的例子
新建 test.html
<!DOCTYPE html>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<head>
<title>验证码</title>
<script src = "checkCode.js"> </script>
</head>
<body>
<p>
<input type = "text" id = "input"/>
<input type = "button" id="code" onclick="createCode()"/>
<input type = "button" value = "验证" onclick = "validate()"/>
</p>
</body>
</html>新建 checkCode.js
2、点击的时候不会移动位置的代码:
<p class="red"><a href="javascript:;" rel="external nofollow" onclick="createCode()">看不清?</a></p>
以上就是用JavaScript实现验证码功能实例详解的详细内容,更多请关注Gxl网其它相关文章!