Ray's Test Page - Play audio by clicking on an image

This page was written in response to a problem a Lycos user had

Clicking on the above image, which is simply a link, will bring up the download dialog.

<a href="spring.mp3"><img border="0" src="spring.jpg" width="117" height="91"></a>

Clicking on the above image, which is an onclick event, the audio file will simply play.

In the BODY section of the HTML code I put...

<embed name="myaudio" src="spring.mp3" hidden="true" autostart="false">

To display the image I used...

<img border="0" src="spring.jpg" width="117" height="91" onclick="javascript:document.myaudio.play()">

This code will only work with Internet Explorer and WebTV

This page created 26th January 2006, last modified 26th January 2006