Adding IFRAME to DOM by Javascript

前端 未结 3 1007
醉酒成梦
醉酒成梦 2021-02-15 17:45

I want to add an iframe to the page. This iframe should refer to a URL. I added the below code to page HTML, but it doesn\'t work:

docu         


        
3条回答
  •  独厮守ぢ
    2021-02-15 18:19

    You need to append the node to the DOM using document.appendChild

    You also need to escape your inner single-quotes or use double-quotes instead.

提交回复
热议问题