<! DOCTYPE html>
<meta charset= "UTF-8" >
<title>Title</title>
<link rel= "stylesheet" href= "Css/index.css" >
<link rel= "stylesheet" href= "Css/font-awesome-4.5.0/css/font-awesome.css" >
<style>
*{
margin:0px;
padding:0px;
}
body{
background:red;
}
. box{
width:280px;
height:260px;
Background: #ffffff;
margin:50px Auto;
Text-align:center;
position:relative;
}
. Box input{
margin-left:20px;
width:210px;
height:27px;
}
. box. text{
margin-top:25px;
}
div{
margin-top:10px;
}
. hide{
Position:absolute;
top:100px;
left:23px;
margin-top:10px;
width:220px;
}
. box. Form. loginbtn. btn{
Display:inline-block;
width:210px;
height:25px;
line-height:25px;
background:red;
Color: #fff;
Text-decoration:none;
margin-top:10px;
margin-left:20px;
Position:absolute;
top:175px;
left:14px;
}
h2{
font-size:18px;
}
. title{
padding-top:10px;
}
. zy{
Position:absolute;
top:110px;
right:30px;
Cursor:pointer;
}
. by{
Position:absolute;
top:110px;
right:30px;
z-index:999;
Cursor:pointer;
}
. Zy i,.by i{
font-size:30px;
}
. password. pass{
margin-left:20px;
}
. Login i{
width:17px;
height:17px;
padding:6px;
border:1px solid #999999;
Border-right:none;
Background: #cccccc;
Color: #666;
Position:absolute;
top:69px;
left:13px;
}
. Word i{
width:17px;
height:17px;
padding:6px;
border:1px solid #999999;
Border-right:none;
Background: #cccccc;
Color: #666;
Position:absolute;
top:110px;
left:13px;
}
</style>
<body>
<div class= "box" >
<div class= "Form" >
<div class= "title" >
</div>
<div class= "Login" >
<span class= "Logn" ><i class= "fa fa-file-movie-o" aria-hidden= "true" ></i></span>
<!--<span class= "Logn" ><i class= "Iconfont" >& #xe6eb;</i></span>-->
<input type= "text" class= "text" placeholder= "Please enter account" >
</div>
<div class= "Password" >
<span class= "word" ><i class= "Iconfont" >& #xe6eb;</i></span>
<input type= "password" class= "pass" placeholder= "Please enter password" >
<span class= "word" ><i class= "Iconfont" >& #xe6eb;</i></span>
<input type= "text" style= "Display:none" class= "Hide" placeholder= "Please enter password" >
<span class= "Show by" ><i class= "Iconfont" >& #xe8df;</i></span>
<span class= "show Zy" style= "Display:none" ><i class= "Iconfont" >& #xe684;</i></span>
</div>
<div class= "LOGINBTN" >
<a href= "javascript:;" class= "BTN" > Login </a>
</div>
</div>
</div>
</body>
<script src= "Jquery-1.12.2.min.js" ></script>
<script>
$ (function () {
var arr = "";
var a = 0;
$ (". Password. Pass"). Change (function () {
Arr = $ ('. Password. Pass '). Val ();
$ ('. Password. Hide '). val (arr);
});
$ (". Password. Hide"). Change (function () {
Arr = $ ('. Password. Hide '). Val ();
$ ('. Password. Pass '). Val (arr);
});
$ (". Password. Show"). Click (function () {
a++;
if (a%2==1) {
$ ('. Password. Pass '). Hide ();
$ ('. Password. Hide '). Show ();
$ ('. Password. by '). Hide ();
$ ('. Password. Zy '). Show ();
}
if (a%2==0) {
$ ('. Password. Pass '). Show ();
$ ('. Password. Hide '). Hide ();
$ ('. Password. by '). Show ();
$ ('. Password. Zy '). Hide ();
}
});
});
</script>
Application of Font-awesome-4.5.0/css/font-awesome.css font icon