16 lines
345 B
JavaScript
16 lines
345 B
JavaScript
|
let bob = document.getElementById("bob");
|
||
|
let help = document.createElement("audio");
|
||
|
help.src = "/assets/audio/bob.ogg";
|
||
|
help.loop = true;
|
||
|
bob.appendChild(help);
|
||
|
window.addEventListener("load", function () {
|
||
|
help.play();
|
||
|
help.muted = true;
|
||
|
});
|
||
|
bob.onmouseover = () => {
|
||
|
help.muted = false;
|
||
|
};
|
||
|
bob.onmouseout = () => {
|
||
|
help.muted = true;
|
||
|
};
|