0
var iframe = $('iframe').contentWindow.document.getElementById('idclick');
iframe.click()

this clicks an element id but throws undefined so I cannot process anything after iframe.click()

Why does it show undefined but yet clicks? Is it because I'm mixing jquery with javascript? If so, how would I write this either fully on jquery or js.

A solution with both jquery and js is + point, I'd like to see the difference.

ISSUE:

var iframe is undefined.
Biplov
  • 1,136
  • 1
  • 20
  • 44
  • Does it say what is undefined? – Huangism Feb 22 '18 at 20:48
  • Please share a [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) – Ele Feb 22 '18 at 20:49
  • @Huangism I'm assuming var iframe is undefined? As it says undefined, right after the .click() statement. – Biplov Feb 22 '18 at 20:50
  • Possible duplicate of [How to access the content of an iframe with jQuery?](https://stackoverflow.com/questions/1796619/how-to-access-the-content-of-an-iframe-with-jquery) – Huangism Feb 22 '18 at 20:56
  • Check the dupe question, your problem is getting content in the iframe. Also, https://stackoverflow.com/questions/16928860/jquery-to-trigger-a-click-on-an-iframe is actually a more precise dupe – Huangism Feb 22 '18 at 20:57
  • That doesn't help me with the syntax. – Biplov Feb 22 '18 at 21:04

0 Answers0