One of the features of computer applications is that there is feedback when you do something. The most common type of feedback is sound. The computer clicks when you select things, beeps when there are errors, and makes other noises to alert you to situations. But web pages don't have this type of feedback. This makes them seem dull or non-responsive.
Mar 24, 2014 I'm still new to all this, but I'm trying to add audio mp3 sound to an HTML image, which is played when clicked on. How can I do this right? I've already tries a few things, like the ' tag, or installing java-based stuff, like soundmanager2, however none of them seems to work. HTML Sound Tutorial Bringing Sound to Your Web Page. Code for HTML sound tags, how to have sound on your Web page. A free tutorial with code examples for coding HTML sounds and linking to sounds, as well as how to play an audio file as the Web page is loading. To hear the file play, you click on the image of the French horn.
Luckily it's easy to change that. Using dynamic HTML attributes and sounds, you can create a web page that acts more like an application.
![Image Image](http://jplayer.org/graphics/jplayer_demo_circle_player.jpg)
Add Sound When a Customer Clicks Something
This script will add sound effects when a customer clicks on something using the attribute and when a customer rolls over something using the attribute. Be sure to test them in different browsers, as not all web browsers handle on mouseover and on click attributes on elements other than links.
Place the following script in the HEAD of your HTML document:
Place Sound in an Empty Span
The JavaScript places an EMBED element inside an empty SPAN element when the script is initiated. So, you need to add the following SPAN tag somewhere within the BODY of your HTML page, preferably near the top of the document:
Call the Script With an Attribute
The last thing you need to add is an element that you want to generate the sound on click or on mouseover. Call the script with one of these attributes. Replace UrlToSoundFile with the full URL to the sound file you'd like it to play:
Here is the entire HTML document, playing the sound of a bluejay. The sound file is stored in the same directory as the HTML page: