How to add audio to a HTML image? -


i'm still new this, i'm trying add audio mp3 sound html image, played when clicked on. how can right?

i've tries few things, '' tag, or installing java-based stuff, soundmanager2, none of them seems work. problem is, don't know how use them properly.

i'm using dreamweaver cs6, in there should option "behaviour"--> play sound, it's not there, i'm lost this.

you can achieve using audio , video dom methods play() , pause() onclick of image working demo

<audio id="audio_play">     <source src="http://www.w3schools.com/tags/horse.ogg" type="audio/ogg" />     <source src="http://www.w3schools.com/tags/horse.mp3" type="audio/mpeg" /> </audio>  <img src="http://bit.ly/1kx7d49" onclick="document.getelementbyid('audio_play').play(); return false;" />  <img src="http://bit.ly/1mq0tit" onclick="document.getelementbyid('audio_play').pause(); return false;" /> 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -