parent.mainFrame.document.body.insertAdjacentHTML("afterBegin","afterBegin ");
参数有两个,第一个,插入位置;第二个,插入内容;
第一个参数的意义:
[插在这里,值为"beforeBegin"]<div id=test>[插在这里,值为"afterBegin"]
层内文字
[插在这里,值为"beforeEnd"]</div>[插在这里,值为"afterEnd"]
本文介绍了如何使用insertAdjacentHTML方法在HTML元素的不同位置插入内容。该方法接受两个参数:插入位置和插入的内容。
parent.mainFrame.document.body.insertAdjacentHTML("afterBegin","afterBegin ");
参数有两个,第一个,插入位置;第二个,插入内容;
第一个参数的意义:
[插在这里,值为"beforeBegin"]<div id=test>[插在这里,值为"afterBegin"]
层内文字
[插在这里,值为"beforeEnd"]</div>[插在这里,值为"afterEnd"]
1万+
1530

被折叠的 条评论
为什么被折叠?