codice:
<html>
<head>
<title>Sound</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<bgsound src="#" id="soundeffect" loop=1 autostart="true" />
<script type="text/javascript">
var soundfile="sound.wav"
function playsound(soundfile){
if (document.all && document.getElementById){
document.getElementById("soundeffect").src=soundfile
}
}
function bindsound(tag, soundfile, masterElement){
if (!window.event) return
var source=event.srcElement
while (source!=masterElement && source.tagName!="HTML"){
if (source.tagName==tag.toUpperCase()){
playsound(soundfile)
break
}
source=source.parentElement
}
}
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
Esempio
</body>
</html>