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"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US">
<head><title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Content-Script-Type" content="text/javascript">
</head>
<body>
<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>
</body></html>
[J]ona
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.
[J]ona
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks