-1

I'm trying to run a javascript command on this site: http://cur.lv/r5pid to click "Skip Ad", but it does not work. The command is this: document.getElementById('skip-ad')click(). But I get an error message claiming that the id skip-ad is null: Uncaught TypeError: Can not read property 'click' of null (...)

Can someone lend a hand? Thanks.

Leon Adler
  • 2,570
  • 1
  • 26
  • 40

1 Answers1

1

document cannot find such an element, because it's inside an "iframe". You can use document to find the iframe, and then find the wanted element in the iframe. For example:

document.getElementById('myframe1').contentWindow.document.getElementById('x')

Reference (and possibly a duplicate of): How to pick element inside iframe using document.getElementById

Community
  • 1
  • 1
NoName
  • 81
  • 5