DEV Community

Discussion on: How do I get all the input tag elements on a web page?

Collapse
 
rhymes profile image
rhymes

The form is inside an iframe, which is technically a separate page so they are not going to appear in the document. You can access the frames with window.frames.

There's a caveat you might not be able to access those elements in the first place. For example Firefox blocks you because the frame is not from the same origin:

You can find more info about the error here: developer.mozilla.org/en-US/docs/W...

Collapse
 
sunilc_ profile image
Sunil Kumar

Awesome. Is there a way to go around this error and access the input elements?

Collapse
 
somedood profile image
Basti Ortiz

Unfortunately, there is none, my friend. However, what you can do is go to the src of the <iframe> and run your original script from there. I ran it myself and I was able to retrieve 28 items.

Collapse
 
rhymes profile image
rhymes

Nope, since it's a security risk :)