Home > front end >  Study analysis code as shown in figure
Study analysis code as shown in figure

Time:12-04

Regardless of CSS styles, this simple code, (pictured) [/code] beg god for help,

CodePudding user response:

You look at the operator do not meet the requirements of your

 



<meta charset="utf-8"/& gt;


<body>









Password
Confirmpassword

<script>
Var a=document. GetElementById (" a ");
Var b=document. GetElementById (" b ");
Var a1=document. GetElementById (" a1 ");
Var b1=document. GetElementById (" b1 ");
A.o nchange=function () {
If (Dr. Alue. Length & lt; 6 | | Dr. Alue. Length & gt; 20) {
A1. Style. The visibility="visible";
}
The else {
A1. Style. The visibility="hidden";
}
}
B.o nchange=function () {
If (Dr. Alue!=b.v alue) {
B1. Style. The visibility="visible";
}
The else {
B1. Style. The visibility="hidden";
}
}
</script>


CodePudding user response:

Code has a small problem
[br]If first to enter the second password box, in no matter how to enter, enter the first password box under the errors are in,

CodePudding user response:


Now it's all right, there is a password box how small eyes?

CodePudding user response:

 



<meta charset="utf-8"/& gt;


<body>









Password
Confirmpassword

<script>
Var a=document. GetElementById (" a ");
Var b=document. GetElementById (" b ");
Var a1=document. GetElementById (" a1 ");
Var b1=document. GetElementById (" b1 ");
Var a2=document. GetElementById (" a2 ");
Var b2=document. GetElementById (" b2 ");
The function the validate () {
If (Dr. Alue. Length & lt; 6 | | Dr. Alue. Length & gt; 20) {
A1. Style. The visibility="visible";
}
The else {
A1. Style. The visibility="hidden";
}
If (Dr. Alue!=b.v alue) {
B1. Style. The visibility="visible";
}
The else {
B1. Style. The visibility="hidden";
}
}
A2. The onclick=function () {
If (al-qeada etAttribute (" type ")=="text") {
A.s etAttribute (" type ", "password");
A2. InnerHTML="biyan"
}
The else {
A.s etAttribute (" type ", "text");
A2. InnerHTML="zhengyan"
}
}
B2. Onclick=function () {
If (b.g etAttribute (" type ")=="text") {
B.s etAttribute (" type ", "password");
B2. InnerHTML="biyan"
}
The else {
B.s etAttribute (" type ", "text");
B2. InnerHTML="zhengyan"
}
}
</script>




Can find themselves a picture when the eyes, I directly use the label

CodePudding user response:

1: the form (front and back side) is the best unified authentication
2: you said that should be a little eyes browser support for the type="password"
  • Related