Page 1 of 1

Javascript sound code

Posted: Tue Feb 10, 2004 1:21 pm
by gbteg3
How would I use javascript to make a sound play over a link? ONclick or onchange?

Posted: Tue Feb 10, 2004 7:51 pm
by Unipus
onrollover. but please don't do that.

Posted: Wed Feb 11, 2004 9:14 am
by gbteg3
its for a class in school....It wont make it to the internet where everyone sees....I agree with you. Thanks alot.

Posted: Wed Feb 11, 2004 1:15 pm
by gbteg3
by any chance do you have an example of how to do it? I have been searching the internet since my last post this morning. I can't find anything.

Posted: Wed Feb 11, 2004 8:27 pm
by d3ad1ysp0rk

Code: Select all

<script language="javascript">
function playsound()&#123;
  document.write("code to play sound");
&#125;
</script>

Code: Select all

<a href="page.html" onrollover="playsound();">Page</a>

Posted: Thu Feb 12, 2004 9:37 am
by gbteg3
New bie question...if the sound file was back.wav. where would i put it. Never used javascript before this. Thanks.