網(wǎng)站首頁(yè) 編程語(yǔ)言 正文
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
.dl {
width: 300px;
background: #f2f2f3;
text-align: center;
}
.dl .log {
font-size: 16px;
font-weight: bold;
}
.dl form {
margin-top: 15px;
position: relative;
}
.dl form input {
width: 200px;
height: 45px;
outline: none;
margin-bottom: 10px;
border: 1px solid #e5e5e5;
padding: 0 10px;
border-radius:5px;
}
.dl form button {
margin-top: 5px;
width: 220px;
height: 45px;
font-size:18px;
border: none;
border-radius: 5px;
margin-bottom: 10px;
}
.dl form .btn {
background: #03a9f4;
color: white;
}
.ico_eye {
background: url(../3dm/img/img-login.png) no-repeat;
background-size: 48px auto;
background-position: 0 -151px;
width: 18px;
height: 16px;
position: absolute;
right: 50px;
top: 68px;
}
.ico_eye.on {
background-position: -26px -151px;
}
</style>
</head>
<body>
<div class="dl">
<div class="log">賬號(hào)登錄</div>
<div class="form-box">
<form>
<input type="text" placeholder="請(qǐng)輸入手機(jī)號(hào)碼" tabindex="1" class="name" size="30" autocomplete="off"><br>
<div class="ico_eye"></div>
<input type="password" placeholder="密碼" tabindex="2" class="pwd" size="30"><br>
<button class="btn">登錄</button>
</form>
</div>
</div>
//引入jQuery
<script src="js/jquery-3.6.0.js"></script>
<script>
//點(diǎn)擊事件
$(".ico_eye").click(function(){
//如果有on 就刪除 把 密碼框type值改成password
if($(".ico_eye").hasClass("on")){
$(".ico_eye").removeClass("on")
$("input[type='text']").attr("type","password")
}else{
//否則就添加on 把password改成text 就能看到密碼
$(".ico_eye").addClass("on")
$("input[type='password']").attr("type","text")
}
})
</script>
</body>
</html>
效果
原文鏈接:https://blog.csdn.net/wwwwwwzzz/article/details/125918671
相關(guān)推薦
- 2022-09-05 Spring 解決循環(huán)依賴(lài)
- 2022-02-16 oracle導(dǎo)出表報(bào)錯(cuò)Access violation at address
- 2022-08-10 .Net使用Cancellation?Framework取消并行任務(wù)_實(shí)用技巧
- 2023-11-16 【云原生】服務(wù)器重啟后,如何將dockers和docker里的服務(wù)重啟
- 2022-11-27 深入了解Linux的文件權(quán)限_linux shell
- 2022-09-26 Ajax異步請(qǐng)求的五個(gè)步驟及實(shí)戰(zhàn)案例_AJAX相關(guān)
- 2022-04-22 mac解決npm不管裝啥都是zsh: command not found
- 2023-10-28 如何給k8s集群里的資源打標(biāo)簽_云其它
- 最近更新
-
- window11 系統(tǒng)安裝 yarn
- 超詳細(xì)win安裝深度學(xué)習(xí)環(huán)境2025年最新版(
- Linux 中運(yùn)行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲(chǔ)小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎(chǔ)操作-- 運(yùn)算符,流程控制 Flo
- 1. Int 和Integer 的區(qū)別,Jav
- spring @retryable不生效的一種
- Spring Security之認(rèn)證信息的處理
- Spring Security之認(rèn)證過(guò)濾器
- Spring Security概述快速入門(mén)
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權(quán)
- redisson分布式鎖中waittime的設(shè)
- maven:解決release錯(cuò)誤:Artif
- restTemplate使用總結(jié)
- Spring Security之安全異常處理
- MybatisPlus優(yōu)雅實(shí)現(xiàn)加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務(wù)發(fā)現(xiàn)-Nac
- Spring Security之基于HttpR
- Redis 底層數(shù)據(jù)結(jié)構(gòu)-簡(jiǎn)單動(dòng)態(tài)字符串(SD
- arthas操作spring被代理目標(biāo)對(duì)象命令
- Spring中的單例模式應(yīng)用詳解
- 聊聊消息隊(duì)列,發(fā)送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠(yuǎn)程分支