You are here:

DHTML/Click to play sound

Advertisement


Question
Hello! Well I am trying to make it so that on my website when a visitor clicks on a picture, it plays a sound. For example, if I click on a picture of a car it plays the sound I want it to. If you know the code so I can do this, that would be great. I am pretty sure I am in the right category to ask this, and I hope to hear from you soon.

Answer
Hi Dylan,

This tutorial, though long, is the best I've found.  It takes you through each step of the process and looks easy to follow given some patience.  Follow it through and you'll have sound working in every browser.

http://www.boutell.com/newfaq/creating/scriptsound.html

Best of luck,
Andrew

DHTML

All Answers


Answers by Expert:


Ask Experts

Volunteer


Andrew Hoffman

Expertise

Ask me about JavaScript, CSS, HTML5/XHTML, or PHP. Chances are I'll be able to help you. I know the economy is in the tank, but if you like my answer, please consider donating a few bucks. It's like tipping your barista, if your barista served fresh code instead of coffee.

Experience

I started doing this when boy bands were still cool.

Education/Credentials
I read a lot of nerdy books to get here.

©2012 About.com, a part of The New York Times Company. All rights reserved.