0
On click audio
I am working on an alphabets kid learning website, and want to play a sound on clicking an image. e.g. if user clicks on A(image) then in background sound of pronunciation of A must be played. Can it possible without using java script? If no Could anyone help?
2 Answers
+ 1
Yes it is possible just add your audio to your webpage . And then make a button with onclick attribute by which you want to play your audio . And use js to play it on clicking.
Ex
<audio id="myAudio">
<source src="horse.ogg" type="audio/ogg">
</audio>
<button onclick="playAudio()" type="button">Play Audio</button>
<script>
var x = document.getElementById("myAudio");
function playAudio() {
x.play();
}
</script>
0
tax bro...