views:

28

answers:

1

I am working on a javascript downloader and need to click a button. I can see the button and get it's values with web developer and dom inspector in FF. But when I try to:

var freeUserForm = this.iFrame.contentDocument.getElementById('js_free-download_btn');

It returns null and when I view the page source the element is not there. So what's going on?

Thank you very much, Todd

A: 

(assuming that the ID of the IFRAME element is "foo")

var iframe = document.getElementById("foo");
var freeUserForm = iframe.contentDocument.getElementById("js_free-download_btn");
Šime Vidas