I am using the following script posted on this site: http://www.javascriptkit.com/script/…oundlink.shtml
It works great, but I want to extend this script and mute the sound using a checkbox. This checkbox has the id: sound. If checked, I want to hear the sounds, when unchecked, no sounds should be heard.
This is the code I currently have for the checkbox:
Code:
function playSound() {
if (document.getElementById('sound').checked){
-something needs to be added here to make it work?-
}
}
Anyone have an idea how to make this work?
Many thanks
function muteIt(box) {
if (clicksound){
clicksound.muted = box.checked?true:false;
}
if (mouseoversound){
mouseoversound.muted = box.checked?true:false;
}
}