您好,登錄后才能下訂單哦!
密碼框的點(diǎn)擊眼睛的顯示與隱藏,圖標(biāo)引用是bootstrap中的fontawesome
(復(fù)制整個(gè) font-awesome 文件夾到您的項(xiàng)目中)
還需要引入
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="Font-Awesome/css/font-awesome.min.css">
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>密碼框</title>
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="Font-Awesome/css/font-awesome.min.css">
</head>
<body>
<div class="content">
<div class="input_block">
<i class="fa fa-eye" onclick="hideShowPsw()" id="eye"></i>
<input type="password" id="password" placeholder="密碼"/>
</div>
</div>
<script type="text/javascript">
var eye = document.getElementById("eye");
var password = document.getElementById("password");
//隱藏text block,顯示password block
function hideShowPsw(){
if (password.type == "password") {
password.type = "text";
eye.className='fa fa-eye-slash'
}else {
password.type = "password";
eye.className='fa fa-eye'
}
}
</script>
</body>
</html>
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。