Html
    Css
    Js

    
                        
.wrap {
	margin:10px auto;
	width:329px;
	height:640px;
	padding-top:200px;
}
.inputBoxContainer {
	width:240px;
	height:50px;
	margin:0 auto;
	position:relative;
}
.inputBoxContainer .bogusInput {
	width:100%;
	height:100%;
	border:#c3c3c3 1px solid;
	border-radius:7px;
	-moz-border-radius:7px;
	-webkit-border-radius:7px;
	overflow:hidden;
	position:absolute;
	z-index:0;
}
.inputBoxContainer .realInput {
	width:100%;
	height:100%;
	position:absolute;
	top:0;
	left:0;
	z-index:1;
	filter:alpha(opacity=0);
	-moz-opacity:0;
	opacity:0;
}
.inputBoxContainer .bogusInput input {
	padding:0;
	width:16.3%;
	height:100%;
	float:left;
	background:#ffffff;
	text-align:center;
	font-size:20px;
	border:none;
	border-right:#C3C3C3 1px solid;
}
.inputBoxContainer .bogusInput input:last-child {
	border:none;
}
.showValue {
	width:240px;
	height:22px;
	line-height:22px;
	font-size:16px;
	text-align:center;
	margin:0 auto;
}

                        
↑上面代码改变,会自动显示代码结果 jQuery调用版本:1.11.3
 立即下载

原生js实现一个 密码输入框

0