Html
    Css
    Js

    
                        
*{
	margin:0;
	padding:0;
}
.content{
	width:800px;
	margin:50px auto;
}
.title{
	font-size:18px;
	font-weight:bold;
	padding-left:340px;
	margin-bottom:30px;
}
input{
	border:1px solid #a9a9a9;
	height:34px;
	line-height:34px;
	width:550px;
	margin-bottom:20px;
	padding-left:5px;
}
label{
	width:120px;
	text-align:right;
	display:inline-block;
}
#registerBtn{
	background:#3498db;
	color:#fff;
	font-size:14px;
	text-align:center;
	width:100px;
	line-height:34px;
	border:none 0;
	cursor:pointer;
	margin:20px 20px 0 0;
	margin-left:120px;
}
label span{
	color:red;
}
#errContent{
	padding:20px 0 0 30px;
	text-align:center;
}

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

原生js表单验证代码

0