HTML Q. This is what i wanna do have these images where when u click them

Nathan D

New member
it makes a sound and links to a site? Kinda confused how this would work and what type of sound do i need? if i could use a .wav sound i would be so happy thank you for answering :D
 
*Add this between <head></head>:
<script type="text/javascript">
var file_sound = "location of sound file"
function playSound() {
document.getElementById("sound").src = file_sound;
}
</script>

*Add this right after <body>:
<bgsound src="" id="sound"></bgsound>

*Add this, id="playSound()" , to the image you want to make a sound when click. For example:
<a href="link location" ><img src"" id="playSound()" /></a>

The sound can be .wav or .midi to play. You might be able to play .mp3 too. Just try.
That should do it....
 
Back
Top