0

As the title says I need to create a bookmarklet in javascript that keeps refreshing a page and checks if a div is present on that page. Using the snippet of the code below the page is refreshing but when I log the div it is always undefined even if the div with the class container is present. How to do it?

document.write(`<frameset><frame src="${location.href}"></frameset>`);
setInterval(() => {
    console.log(document.getElementsByClassName("container")[0].innerText);
    document.getElementsByTagName('frame')[0].src += ''

    },
    5000);
JayJona
  • 469
  • 1
  • 16
  • 41
  • 1
    You are not accessing the frame content. If the container is supposed to be from the frame you need more code – mplungjan Jan 10 '23 at 11:02

0 Answers0