📌  相关文章
📜  document.createElement('iframe'); - Javascript代码示例

📅  最后修改于: 2022-03-11 15:03:31.290000             🧑  作者: Mango

代码示例1
var ifrm = document.createElement('iframe');
ifrm.setAttribute('id', 'ifrm'); // assign an id

//document.body.appendChild(ifrm); // to place at end of document

// to place before another page element
var el = document.getElementById('marker');
el.parentNode.insertBefore(ifrm, el);

// assign url
ifrm.setAttribute('src', 'demo.html');