Home > front end >  Why can't a onsubmit submit false
Why can't a onsubmit submit false

Time:05-18

 & lt; ! DOCTYPE html> 

<meta charset="utf-8" & gt;
<meta HTTP - equiv="X - UA - Compatible" content="IE=edge" & gt;
<meta name="viewport" content="width=device - width, initial - scale=1.0" & gt;
Document The function checkUser () {
Var uname=document. QuerySelector (" # "UN"). The value;
Var len=uname. Length;
Var ino=uname. ToLowercase. IndexOf (" admin ");
If (len<3 | | len> 30 | | ino!=1) {
Alert (" username illegal!" );
return false;
}
return true;
}
</script>

<body>

User name: & lt; Input type="text" id="UN" & gt;


  • Related