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

146
Views
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 answers
Answer question

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 Report

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 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!