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 Answers
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