Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

155
Views
Inicie sesión en Enviar sin redirigir a otro archivo html

Hice un inicio de sesión con javascript donde, si ingresa el nombre de usuario y la contraseña correctos, puede ingresar a la página de inicio. Puede encontrar el nombre de usuario y la contraseña en el script. Termino el código javascript y probé el inicio de sesión. Cuando entré, no redirigió al archivo html de la página de inicio, sino que simplemente se recargó. El problema principal es que, cuando envío/inicio sesión con el nombre de usuario y la contraseña, no va al archivo html de la página de inicio. Aquí está el código:

 function Login() { var username = document.getElementById("user").value; var password = document.getElementById("pass").value; if (username == "will" && password == "will") { window.location.href = "home.html"; } else { alert("Sadly, your not in the club"); } }
 @import url("https://fonts.googleapis.com/css2?family=Amatic+SC&display=swap"); * { font-family: "Amatic SC", cursive; text-align: center; } form { text-align: center; justify-content: center; height: 400px; } h1 { padding: 30px; } input, button { padding: 10px; width: 110px; font-size: 30px; }
 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta http-equiv="X-UA-Compatible" content="ie=edge" /> <title>.WWW Login</title> </head> <body> <form> <h1>.WWW Login</h1> <input placeholder="Username" type="text" id="user" required /> <br /> <br /> <input placeholder="Password" type="password" id="pass" required /> <br /> <br /> <button onclick="Login();">Login</button> </form> </body> </html>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!