HTML --JS 密码验证

 1 l>
 2     <head>
 3         <title>js</title>
 4         <script language="JavaScript"> 
 5             function check(obj){
 6                 var pass1=document.getElementById("p1").value;
 7                 var pass2=obj.value;
 8                 if(pass1==pass2){
 9                     document.getElementById("tip").innerText="两次密码一致";
10                 }else{
11                     document.getElementById("tip").innerText="两次密码不一致";
12                 }
13             }
14             function move(obj){
15                 document.getElementById("pic").innerHTML="<img src='"+obj.src+"' width='200px' height='200px'> ";
16             }
17             function out(obj){
18                 document.getElementById("pic").innerHTML="";
19             }
20             
21         </script>
22     </head>
23     <body>
24         请输入密码:<input type="password" ><br/>
25         请确认密码:<input type="password"  onblur="check(this)" ><br/>
26         <div >  </div>
27         <img src="cc.png"  width="100px" height="100px" onmousemove="move(this)" onmouseout="out(this)">
28         <img src="cx.png"  width="100px" height="100px" onmousemove="move(this)" onmouseout="out(this)">
29         <div ></div>
30     </body>
31 </html>