当前位置:网站首页>Can you make a JS to get the verification code?
Can you make a JS to get the verification code?
2022-07-26 05:47:00 【Mark community】
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title> Verification Code </title>
<style>
.get{
cursor: pointer;
}
.reset{
display: none;
}
.reset span{
color:red;
}
</style>
</head>
<body>
<input type="text"><button> determine </button>
<p class="get"> Get verification code </p>
<p class="reset"> Reacquire the captcha <span>10</span>s</p>
</body>
<script>function $(el) {
return document.querySelector(el);
}
let val="";
let timer=null;
function stop() {
clearInterval(timer);
timer=null;
}
$(".get").onclick=function(){
this.style.display="none";
$(".reset").style.display="block";
var chars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
function generateMixed(n) {
var res = "";
for(var i = 0; i < n; i++) {
var id=Math.ceil(Math.random() * 35);
res +=chars[id];
}
return res;
}
var num1=generateMixed(4);
val=num1;
alert(num1);
var i=10;
timer=setInterval(() => {
i--;
$(".reset span").innerText=i;
if(i===0){
stop();
$(".reset").style.display="none";
$(".get").style.display="block";
}
}, 1000);For more information, please refer to the original , Reproduced from :https://blog.csdn.net/weixin_44519496/article/details/120074372
边栏推荐
- Usage and common problems of SIP softphone registered with SIP account
- The refurbishment and counterfeiting of chips have made people feel numb
- MBA-day28 数的概念-练习题
- 金仓数据库 KingbaseES SQL 语言参考手册 (7. 条件表达式)
- Redis persistence AOF
- How to understand "array name is essentially an address" from the perspective of memory parsing?
- 嵌入式通用学习路线整理
- leetcode-Array
- 金仓数据库 KingbaseES SQL 语言参考手册 (9. 常见DDL子句)
- Thread三种实现方式 和 Handler的用法
猜你喜欢

金仓数据库 KingbaseES SQL 语言参考手册 (6. 表达式)

Dynamic memory management and flexible array

idea yml 文件代码不提示解决方案

Hack the box - Introduction to networking module detailed Chinese tutorial

How students apply for free idea

QT writing IOT management platform 47 general database settings

You'd better not take this kind of project!

Full binary tree / true binary tree / complete binary tree~

金仓数据库 KingbaseES SQL 语言参考手册 (8. 函数(十))

DOM operation -- operation node
随机推荐
Who is responsible for the problems of virtual idol endorsement products? And listen to the lawyer's analysis
102. (cesium chapter) cesium road streamer
中文文本纠错任务简介
It's enough for newcomers to learn how to do functional tests
高效,可靠,安全的串口通讯开源方案
ERROR: Could not open requirements file: [Errno 2] No such file or directory: ‘requirments.txt’
三本毕业,三年嵌入式软件的心路历程
Jupiter notebook shortcut key
Motor control column summary
电机控制专栏文章汇总
520送什么?DIY一个高颜值RGB时钟,女生看了都想要
[MySQL must know and know] time function number function string function condition judgment
Mba-day28 concept of number - exercise questions
Benji Bananas 开启第二季边玩边赚奖励活动,支持使用多张 Benji 通行证!
Three implementation methods of thread and the usage of handler
Chapter 1 - Construction of development environment
Processing method of CDC in SDC
如何查看Pod里容器名称
No EGL Display 报错解决
MongoDB 常用命令