How can I access the document property of another html page?

  • 0
    One html page has a button, through document I can refer to it, and there is the same button on another page. How can I access the second button while on the first page?
    JavaScript Anonymous, Jun 10, 2019

  • 2 Answers
  • 0
    By pages do you mean tabs from the same browser?



    If both pages are on the same site, then this is possible through messages, localStorage, workers, etc.

    Otherwise, you have to make friends .



    As a last resort - write and then use your browser extension, giving it the rights to access the data of any tabs.
    Stella Cooke

  • 0
    If you open a tab through window.open

    From child to parent

    https://developer.mozilla.org/en-US/docs / Web / API / W ...



    To reach the child from the parent

    https://developer.mozilla.org/en-US/docs / Web / API / W ...


    Anonymous

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!