Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

98
Vistas
click button by javascript after popup appears

So, on the website, there's a button after which you click, there appears a new popup that also has a button. What I am trying to achieve is that by javascript, I wanna click the first button and when pop-up appears, i want to click on that another button.

Code:

var arr = document.getElementsByClassName("firstButtonClassName");

for (var i = 1, len = arr.length; i < len; i++) {
   arr[i].click();
   console.log(document.getElementsByClassName("popupButtonClassName"))
}

with the above code, first button is clicked fine and popup appears, but as you can see, console log above prints empty array instead of the array that contains popup's button..

Is there some trick I don't understand ?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda