日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 前端技术 > HTML >内容正文

HTML

html前端登录验证码,前端登录页面开发_js生成验证码并验证

發(fā)布時(shí)間:2025/4/17 HTML 127 豆豆
生活随笔 收集整理的這篇文章主要介紹了 html前端登录验证码,前端登录页面开发_js生成验证码并验证 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

/p>

前端集成開發(fā)工具:

margin: 0;

padding: 0;

}

a {

text-decoration: none;

}

.main_bar {

width: 100%;

height: 350px;

margin-top: 200px;

}

.login_form {

width: 30%;

height: 80%;

margin: 0 auto;

/*border:2px solid #16A085;*/

border-radius: 15px;

padding: 10px;

background: #ECF0F1;

}

.name,

.pwd,

.sbm_btn {

display: block;

width: 70%;

margin: 0 auto;

height: 35px;

font-size: 16px;

border-color: transparent;

border-radius: 5px;

border: 0;

padding-left: 8px;

}

.yzm {

height: 35px;

margin: 0 auto;

width: 72%;

line-height: 35px;

position: relative;

margin-bottom: 10px;

}

.code {

width: 50%;

height: 35px;

border: 0;

border-color: transparent;

font-size: 16px;

border-radius: 5px;

padding-left: 8px;

}

.code_pic {

display: block;

width: 40%;

height: 35px;

background-color: #34495e;

color: #FFF;

position: absolute;

top: 0px;

left: 60%;

border-radius: 5px;

text-align: center;

}

.name {

margin-top: 20px;

}

.sbm_btn {

text-align: center;

background-color: #1abc9c;

color: #fff;

line-height: 35px;

}

.re_pwd {

width: 25%;

margin: 10px auto 10px;

}

.re_pwd a {

text-decoration: none;

font-size: 14px;

color: #ccc;

}

.re_pwd a:hover {

cursor: pointer;

color: #16A085;

}

.errorTips {

width: 70%;

color: red;

font-size: 14px;

margin: 0 auto;

height: 20px;

line-height: 20px;

}

登錄

忘記密碼了

// 聲明一個(gè)變量用于存儲生成的驗(yàn)證碼

document.getElementById(‘code’).οnclick=changeImg;

functionchangeImg(){

// 驗(yàn)證碼組成庫

vararrays=newArray(

‘1’,’2′,’3′,’4′,’5′,’6′,’7′,’8′,’9′,’0′,

‘a(chǎn)’,’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’,

‘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’

);

// 重新初始化驗(yàn)證碼

code=”;

// 隨機(jī)從數(shù)組中獲取四個(gè)元素組成驗(yàn)證碼

for(vari=0; i<4; i++){

// 隨機(jī)獲取一個(gè)數(shù)組的下標(biāo)

varr=parseInt(Math.random()*arrays.length);

code+=arrays[r];

}

// 驗(yàn)證碼寫入span區(qū)域

document.getElementById(‘code’).innerHTML=code;

}

// 驗(yàn)證驗(yàn)證碼

functioncheck(){

varerror;

// 獲取用戶輸入的驗(yàn)證碼

varcodeInput=document.getElementById(‘codeInput’).value;

if(codeInput.toLowerCase() ==code.toLowerCase()){

console.log(‘123’);

returntrue;

}else{

error=’驗(yàn)證碼錯(cuò)誤,重新輸入’;

document.getElementById(‘errorTips’).innerHTML=error;

returnfalse;

}

}

總結(jié)

以上是生活随笔為你收集整理的html前端登录验证码,前端登录页面开发_js生成验证码并验证的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。