[Solved] How do I make a audio play onclicked with one thumbnailed image HTML


The code you need will be something like this:

<head>
<script>
function play(){
  var myAudio = document.getElementById("audio");
  if(myAudio.paused)
    myAudio.play();
  else
    myAudio.pause();
}
</script>
</head>

<body>
<img src="https://stackoverflow.com/questions/35963057/SoundWave.gif" width="200" height="200" onclick="play();">
<audio id="audio" src="01.mp3"></audio>
</body>

you can get more information about html5 audio element and how to work with it using this link

P.S. <img> tag does not have a value property

solved How do I make a audio play onclicked with one thumbnailed image HTML