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

144
Vistas
JS add value in iframe

I am trying to find a way to add a value in a current iframe to submit and resolve hCaptcha.

Currently i can get the iframe using the following:

document.querySelector('[title="widget containing checkbox for hCaptcha security challenge"]')

Due to there is no id, but am able to locate the iframe with the provided code above.

I however cannot find a way due to I am not a JS coder to enter a value for "data-hcaptcha-response" that is in the iframe that i require to enter before i submit the form.

Full iframe code:

<iframe src="xyz" 
 title="widget containing checkbox for hCaptcha security challenge" 
 tabindex="0" frameborder="0" scrolling="no" data-hcaptcha-widget-id="0zlooj2ooak" 
 data-hcaptcha-response="" style="width: 303px; height: 78px; overflow: hidden;"></iframe>

I highly appreciate it if someone could guide me to do this project.

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

This should do the job I guess:

let hcaptcha = document.querySelector('[title="widget containing checkbox for hCaptcha security challenge"]');
hcaptcha.dataset.hcaptchaResponse = "your_value_here";

You can learn more about about using data attributes in javascript here.

about 4 years ago · Juan Pablo Isaza Denunciar

0

I think you are asking for a set value to an attribute. Try this code, I think this will resolve your issue.

document
.querySelector('[title="widget containing checkbox for hCaptcha security challenge"]')
.setAttribute("data-hcaptcha-response", "value of hcaptcha");
about 4 years ago · Juan Pablo Isaza Denunciar
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