如何找到<div>
没有 id 的标签?
这是我的标记:
<body>
<div>this is a text</div>
</body>
div
这是我用来向页面添加 s 的JavaScript :
var show = function () {
var htmlNode = document.createElement('DIV');
document.body.insertBefore(htmlNode, document.body.childNodes[0]);
htmlNode.innerHTML = 'this is a text';
};
if (window.addEventListener) {
window.addEventListener("load", show, true);
} else {
}
window.attachEvent("onload", show);
页面加载后如何删除?通过将 JavaScript 放在页面底部?