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

230
Views
Get value from another #document JavaScript !Doctype

How can I get value from another iframe?

When I inspecting the website and I click on this line:

<input type="hidden" name="1" value="q"›

And I type this to the console:

document.getElementsByName("3")[0].value

I can get the value:

'e'

But if I click outside from iframe, and I check the value I get this result: VM89205:1 Uncaught TypeError: Cannot read properties of undefined (reading 'value') at :1:49

Looks like I have to click inside if I want get the value. Is it possible to get the value without every time click inside?

<iframe name="frame" id="frame" src="TEST.html?token=asdasdasd" style="display: none;"> ==$0 
    #document
      <html>...</html>
     </iframe>                                                                                    
    <form name="apple" id="apple" method="get" action="test.htm?token=asdasdasd" target="dialog">  <input type="hidden" name="1" value="q"›
      <input type="hidden" name="1" value="q"›
      <input type="hidden" name="2" value="wm> 
      <input type="hidden" name="3" value="e"> 
      <input type="hidden" name="4" value="r"› 
      <input type="hidden" name="5" value="e> 
      <input type="hidden" name="6" value="z"> 
      <input type="hidden" name="7" value>
      <input type="hidden" name="8" value="u"> 
      <input type="hidden" name="9" value="i"> 
      <input type="hidden" name="10" value>
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

To access an iframe's content from outside the iframe (provided, it's not an external domain), use document.getElementById("frame").contentWindow.document.getElementsByName("3")[0].value;

about 4 years ago · Juan Pablo Isaza Report

0

Add name tag

<input type="hidden" name="1" name="q" value="q"›



and then type this to get the value

var v = document.getElementById("q").innerHTML;
console.log(v);
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!