这段代码是由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);
}
^ _ ^谢谢,死亡
From: https://bytes.com/topic/javascript/insights/767825-playing-sound-file-javascript-function