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

128
Views
Activate iframe and change its contents

I am losing my marbles over this issue:

There's an iframe that i try to programmatically manipulate, but somehow this is only possible after i go into the developer console and click a parent node.

This is the best i can come up with:

var iframes = document.getElementsByTagName('iframe');
for (var i = 0; i < iframes.length; i++) {
if (iframes[i].parentNode.id == 'cke_355_contents') {
iframes[i].contentWindow.document.open();
iframes[i].contentWindow.document.write('<html><body>Hello World</body></html>');
iframes[i].contentWindow.document.close();
 }
  }

Even if i try to list all iframes on the page:

document.querySelectorAll('iframe').forEach((iframe)=> {
  console.log(iframe.id, iframe.className, iframe.src)
});

i just get the first 2 results. But, when i click a parentnode in the console, it will only list the iframe i actually need.

Is there some way to find the correct iframe,"activate" it and manipulate it?

about 4 years ago · Santiago Gelvez
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!