網站首頁 編程語言 正文
<!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">賬號登錄</div>
<div class="form-box">
<form>
<input type="text" placeholder="請輸入手機號碼" 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>
//點擊事件
$(".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
相關推薦
- 2022-02-24 JDBC中在結果集中以列順序獲取值時注意類型匹配
- 2023-10-26 解決:NODE_ENV 不是內部或外部命令,也不是可運行的程序,或者批處理文件
- 2023-07-18 Spring 中的 Service 有多個實現類如何注入
- 2022-05-15 Python學習之異常處理詳解_python
- 2022-08-01 Python+Selenium鍵盤鼠標模擬事件操作詳解_python
- 2021-12-04 C#獲取Windows10屏幕縮放比例的操作方法_C#教程
- 2023-02-05 python??fire庫的使用實例教程_python
- 2022-10-12 Redis的共享session應用實現短信登錄_Redis
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支