onClick play music
I have an image i would like to link so that when it is clicked a music file is played.
any ideas how i can go about this without opening a new window?
Something like this? (Untested code.)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<p><img src="image.gif" alt="Image description - Play music" onclick="document.getElementById('embMusic').src='music.mp3';"></p>
<p><embed src="" autostart="true"></embed></p>
does "<embed src="" autostart="true"></embed>" need to be named embMusic?
Oh man, I am tired. lol. Okay, you're right. id="embMusic" should be added to it. If it doesn't work, turn EMBED into BGSOUND. Take a look at this script that I made a while ago--it should help you.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)