Home > other >  A simple login page js but alert pop-up window
A simple login page js but alert pop-up window

Time:11-18

According to the book written, don't know where the problem is, please help to have a look at the thank you

<body>

The warning dialog & lt;/strong>






<script>
The function getById (id) {
Return the document. The getElementById (id);
}
GetById (' form - login.) addEventListener (' submit ', function (e) {
Var account=getById (" account "). The value, the trim ();
Var password=getById (" password "). The value, the trim ();
if(! The account)
{
Alert (" please enter the account ');
e.preventDefault();
return false;
}
if(! Password)
{
Alert (" please enter the password ');
e.preventDefault();
return false;
}
});
</script>

CodePudding user response:

Js, not have special Java big section, move where go to, to get better suggestion,

CodePudding user response:

reference 1/f, zara's reply:
js, not have special Java big section, move where go to, to get better advice,

HMMM good hair for the first time may not be too pay attention to thank you for reminding me
  • Related