0

How does this work

Can someone explain how does this code work because it works even if I press Enter? I understand JS code. Code: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>something</title> <script> const x = s => s === '12345678' </script> </head> <body> <form action="index2.html" method="POST" onclick="return(x(p.value))"> <label for="p">Unesi šifru</label> <input type="password" name="p" id="p"> <button> Potvrdi</button> </form> </body> </html>

2nd Oct 2020, 4:51 PM
Cлaвeн Ђервида
Cлaвeн Ђервида - avatar
2 ответов
0
Does it not refresh your page?
2nd Oct 2020, 4:57 PM
🇮🇳Vivek🇮🇳
🇮🇳Vivek🇮🇳 - avatar
0
When the password is correct, it redirect me to indexed.html when it is not, not happens. But how?
2nd Oct 2020, 4:58 PM
Cлaвeн Ђервида
Cлaвeн Ђервида - avatar