Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

140
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda