该代码是由
acoder serveral(139)天前。 因此,我决定将其发布。
function play() {
embed = document.createElement("embed");
embed.setAttribute("src", "soundfile.wav");
embed.setAttribute("hidden", true);
embed.setAttribute("autostart", true);
document.body.appendChild(embed);
}
^ _ ^谢谢,死亡
翻译自: https://bytes.com/topic/javascript/insights/767825-playing-sound-file-javascript-function