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. The problem is, that I don't know how to use them properly.
I'm using dreamweaver CS6, in which there should be an option "behaviour"--> play sound, but it's not there, so I'm lost with all this.
You can achieve that using Audio and Video DOM methods
play()
andpause()
onclick of image working DemoYou can use HTML5 Audio Tag:
More Information: http://www.w3schools.com/html/html5_audio.asp
You won't need any player because html5 is able to play sound files. Check out this: http://www.w3schools.com/html/html5_audio.asp
You can use jQuery to load the sound file.
Maybe you'll need some further code or css to hide controls and stop audio from playing etc.