The reason why this doesn't work is because the <input> elements are inside an <iframe> element. To solve your problem, you may need to be clever about it by (recursively) iterating over all <iframe> elements and their contentWindow properties to access the <input> elements you are looking for.
If you want to keep things simple, you can also just change your onload handler as such:
However, this comes with another problem. The site disables cross-origin access to <iframe> elements for security reasons (which is a very good thing). The main website has a domain of www.wufoo.com while the <iframe> containing the <input> elements comes from the domain gallery.wufoo.com. Since the two domains are not the same, any access to the DOM of the <iframe> is not allowed.
In other words, what you're asking for is impossible because the site is pretty secure (which, again, is a very good thing).
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The reason why this doesn't work is because the
<input>
elements are inside an<iframe>
element. To solve your problem, you may need to be clever about it by (recursively) iterating over all<iframe>
elements and their contentWindow properties to access the<input>
elements you are looking for.If you want to keep things simple, you can also just change your
onload
handler as such:However, this comes with another problem. The site disables cross-origin access to
<iframe>
elements for security reasons (which is a very good thing). The main website has a domain ofwww.wufoo.com
while the<iframe>
containing the<input>
elements comes from the domaingallery.wufoo.com
. Since the two domains are not the same, any access to the DOM of the<iframe>
is not allowed.In other words, what you're asking for is impossible because the site is pretty secure (which, again, is a very good thing).