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

133
Views
¿Por qué el inicio de sesión modal no se cierra al hacer clic fuera del cuadro de inicio de sesión?

He llamado al js como se muestra a continuación:

 <!DOCTYPE html> <html> <head> <meta charset="utf-8" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="modal_style.css"> <script src="modal_js.js"></script> <title>Modal Login Page</title> </head> <body> <h1>Let's get started by</h1> <button onclick="document.getElementById('id01').style.display='block'" style="width:auto;">Login</button> <div id="id01" class="modal"> <form class="modal-content animate" action="/action_page.php" method="post"> <div class="imgcontainer"> <span onclick="document.getElementById('id01').style.display='none'" class="close" title="Close Modal">&times;</span>

Mi archivo JavaScript es el siguiente:

 var modal = document.getElementById('id01'); window.onclick = function(event) { if (event.target == modal) { modal.style.display = "none"; } }

Por favor ayúdame a identificar el error.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

haga un div y coloque el div de inicio de sesión dentro de él y haga clic en el primer div, haga ambos div

 document.getElementById("div1").style.display = "none" document.getElementById("div2").style.display = "none"
about 4 years ago · Juan Pablo Isaza Report
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!