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>
2 Answers
0
Does it not refresh your page?
0
When the password is correct, it redirect me to indexed.html when it is not, not happens. But how?