JS ?? ?? ?? ???? - ?? ??(1)
?? ?? ??? ??? ???????
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style type="text/css"> *{margin:0;padding:0;} #div{width:410px;height:400px;background:#46a3ff;padding-left:16px; padding-top:20px;} input{ outline:none; box-sizing:border-box;padding-left:15px;} textarea{ outline:none;resize : none; box-sizing:border-box;padding-left:15px;padding-top:5px;} .name{width:200px;height:30px;margin-left:8px;border:1px solid #ffc1e0;border-radius:8px;} .pwd{width:200px;height:30px; margin-left:8px;border:1px solid #ffc1e0;border-radius:8px;} .email{width:200px;height:30px;margin-left:8px;border:1px solid #ffc1e0;border-radius:8px;} .txt{ width:280px;height:70px;margin-left:8px;border:1px solid #ffc1e0;border-radius:8px;} .sub{width:100px;height:30px;padding-left:0px; border:none; border-radius:5px;background:#ffd0ff;} .sub:hover{background:#ffaad5;} .div{ width:200px;height:30px;margin:0 auto;box-sizing:border-box;padding-left:45px;padding-top:5px;color:#8600ff;font-weight:bold;} </style> </head> <body> <div id="div"> <form> <label>用戶名:</label> <input type="text" class="name" id="name"> <div id="sp" class="div"></div> <label>密 碼:</label> <input type="password" class="pwd" id="pwd"> <div id="sp1" class="div"></div> <label>郵 箱:</label> <input type="text" class="email" id="email"> <div id="sp2" class="div"></div> <label>愛 好:</label> <textarea rows="5" cols="40" class="txt" id="txt"></textarea> <div id="sp3" class="div"></div> <input type="button" class="sub" value="注冊" id="sub"> </form> </div> </body> </html>
?? ??? ?? ??? ???????.
var sub = document.getElementById('sub');
??????? sub.onclick=function(){
?????????????????????????????????????????????????????????????????????/?? ??? ??? ?? ??? ?????.
? ? ? ? var val = document.getElementById('name').value;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? using ? using ? .innerhtml = "??? ??? ?????!";; }}
?? SUB? ???? ??? ?? ?? ?? ???
var sub = document.getElementById('sub');
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?>? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ???'). ?;
if (value == "") {
document.GetelementByid ("sp").Innerhtml = "??? ??? ?????!";
}
// ???? ???
? ? ? var val1 = document.getElementById('pwd').value; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ?? ?? ? ? ? ? ' s ' s ?? ?? ' s ' ?? ?? ‐ ‐ ‐‐ ‐ to var val1 = ‐ ‐ document.getElementById('pwd').value; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ???????????? }
//驗證郵箱是( "sp2").innerHTML = "請輸入郵箱!" ; document.getElementById("sp3").innerHTML = "??? ?????! ";
??????????????????????????????????????????????????????????????????