Javascript sound code

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
gbteg3
Forum Newbie
Posts: 6
Joined: Tue Feb 10, 2004 1:21 pm

Javascript sound code

Post by gbteg3 »

How would I use javascript to make a sound play over a link? ONclick or onchange?
Unipus
Forum Contributor
Posts: 409
Joined: Tue Aug 26, 2003 2:06 pm
Location: Los Angeles, CA

Post by Unipus »

onrollover. but please don't do that.
gbteg3
Forum Newbie
Posts: 6
Joined: Tue Feb 10, 2004 1:21 pm

Post by gbteg3 »

its for a class in school....It wont make it to the internet where everyone sees....I agree with you. Thanks alot.
gbteg3
Forum Newbie
Posts: 6
Joined: Tue Feb 10, 2004 1:21 pm

Post 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.
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post 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>
gbteg3
Forum Newbie
Posts: 6
Joined: Tue Feb 10, 2004 1:21 pm

Post by gbteg3 »

New bie question...if the sound file was back.wav. where would i put it. Never used javascript before this. Thanks.
Post Reply