Changing the contents of an iframe

后端 未结 3 783
[愿得一人]
[愿得一人] 2021-01-24 01:30

I have an iframe embedded on my webpage and I\'d like to edit certain parts of it using javascript. Is this possible and how would I do it?

3条回答
  •  猫巷女王i
    2021-01-24 02:04

    According to the HTML DOM spec (level 2), you can reach the child DOM by using the .contentDocument property of the iframe's DOM node.

    But, of course, no browser lets you do that across domains anymore...

提交回复
热议问题