【发布时间】:2012-03-03 02:54:43
【问题描述】:
如何检查我的 html 中是否存在嵌入标签。 我已经通过 javascript 创建了这个标签
soundEmbed = document.createElement("embed");
soundEmbed.setAttribute("src", "notify.wav");
soundEmbed.setAttribute("hidden", true);
soundEmbed.setAttribute("autostart", true);
soundEmbed.setAttribute("loop", false);
document.body.appendChild(soundEmbed);
但由于我使用的是 autorefresh 和 appendChild,所以每次刷新都会产生额外的声音。
使用 appendChild,我想我有很多嵌入标签。这就是我认为可能产生额外声音的原因。
【问题讨论】:
标签: javascript tags embed append element