0

I'm working on a little project, and I would like some help on how to dynamically change the value of an input field on this page. It's the input under the "Which school has the most school spirit?" field. For whatever reason, i'm having trouble just using javascript to identify the specified input element. I have'nt wrote javascript in awhile so I (hopefully) might just be missing something.

This is what I had (But it wasn't working):

document.getElementsByClassName("PDF_QT100")[0].children[0].value = "school"

Edit-

And this is the Error I recieve when I run the code on the page in Google Chrome's console:

TypeError: Cannot read property 'children' of undefined
Alex
  • 1,035
  • 3
  • 16
  • 31
  • 1
    Looks an awful lot like you are trying to rig this competition.. – Wez Sep 30 '13 at 22:21
  • 2
    The input field is inside an iframe. – user247702 Sep 30 '13 at 22:21
  • @Wezly, the winner was announced and we're now playing with it – Alex Sep 30 '13 at 22:22
  • This input is in a frame. You cannot access or update content due to security restrictions imposed by the browser. – Paul Rad Sep 30 '13 at 22:26
  • You can't access elements inside an iframe unless the content is from the same domain as your parent page - [Similar Question](http://stackoverflow.com/questions/1451208/access-iframe-elements-in-javascript) – Wez Sep 30 '13 at 22:29

0 Answers0