Click to See Complete Forum and Search --> : Play .wav files with OnClick


elwell
07-24-2003, 12:50 PM
I want to know how to make a function for clicking anywhere on the screen and making it make a sound.
Should i use <body onClick=""> to work the funtction?
and How do i make the function?

Mr J
07-24-2003, 05:28 PM
<script language="javascript">
<!--
function playme(your_sound){
document.getElementById('my_ID').src=your_sound
}

// -->
</script>

<BGSOUND ID="my_ID">


<BODY onclick="playme('enter2.wav')">

Where enter2.wav is your own file.

NOTE: IE only