日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 综合教程 >内容正文

综合教程

html用户注册界面

發布時間:2024/8/24 综合教程 34 生活家
生活随笔 收集整理的這篇文章主要介紹了 html用户注册界面 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

html用戶注冊界面

先上一張簡約的界面的效果圖

這里是style里面的內容

<style>
        input[type]{
            border: 1px solid darkorange;
            background: white;
        }
        #button{
            border: 10px solid orange;
             200px;
            box-shadow:0px 4px 5px #666;
            background: orange;        
            color: white;    
        }
        
    </style>

再來body里面的內容,這里用到的是失焦 onblur 和聚焦 onfocus

<body>
<center>
<div>
<form>
<h3>用戶注冊</h3>
<hr>
<p>用戶名:<input type="text" id="name" placeholder="請填寫用戶名" required="required" onblur="name1()" <!--onfocus="name2()-->"><br><span id="tel"></span></p>
<p>密碼:<input id="paswd" type="password" placeholder="請填寫密碼" onblur="pwd1()" required="required" onfocus="pwd2()"><br><span id="pw"></span></p>
<p>確認密碼:<input id="paswd2" type="password" placeholder="請確認密碼" required="required" onkeyup="validate()" ><br><span id="qpwtx"></span></p>
<p>郵箱:<input type="email" placeholder="請填寫郵箱" required="required"></p>
<p><input type="checkbox" required="required">我已閱讀注冊手冊</p>
<p><input type="submit" id="button" value="注冊"></p>
</form>
</div>
</center>
</body>

最后是js里面的代碼

<script>
function name1(){
var name=document.getElementById("name").value;
if(name.length==""){
document.getElementById("tel").innerHTML="用戶名不能為空"
document.getElementById("tel").style.color="red";
}else{
document.getElementById("tel").innerHTML="√"
document.getElementById("tel").style.color="green";
}
}
// function name2(){
// document.getElementById("tel").innerHTML="請填寫用戶名"
// document.getElementById("tel").style.color="#999";
// }
function pwd2(){
document.getElementById("pw").innerHTML="請填寫6-12位的密碼"
document.getElementById("pw").style.color="#999";

}
function pwd1(){
p=document.getElementById("paswd").value;

if(p.length>=6&&p.length<=20)
{
document.getElementById("pw").innerHTML="√"
document.getElementById("pw").style.color="green";
}else{
document.getElementById("pw").innerHTML="格式錯誤,請輸入6-20位"
document.getElementById("pw").style.color="red";
}
}
function validate(){
var qpw=document.getElementById("paswd").value;
var qpw2=document.getElementById("paswd2").value;

if(qpw==qpw2 && p.length>=6&&p.length<=20){
document.getElementById("qpwtx").innerHTML="<font color='green'>√</font>";
document.getElementById("button").disabled = false;
}
else {
document.getElementById("qpwtx").innerHTML="<font color='red'>兩次密碼不相同或者格式錯誤</font>";
document.getElementById("button").disabled = true;
}
}

</script>

總結

以上是生活随笔為你收集整理的html用户注册界面的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。