I'm making a piano that reproduces the sounds by onclick
but when I click twice on the same note and the first time it keeps playing the second one does not reproduce the sound.
The example is this:
and this is the code:
$(document).ready(function()) {
var sonido = document.getElementById("sonido");
var sonido2 = document.getElementById("sonido2");
var sonido3 = document.getElementById("sonido3"); }
The sound picks up from here:
<audio id="sonido">
<source src="midia/220-A%20(mp3cut.net).mp3">
'
And the onclick is this:
<map name="image-maps-2017-03-24-070855" id="pianomaps">
<area id="negra1" alt="" title="negra1" onclick="sonido16.play()" shape="rect" coords="34,0,62,178" style="outline:none;" target="_self" />
<area id="negra2" alt="" title="negra2" onclick="sonido17.play()" shape="rect" coords="97,0,125,178" style="outline:none;" target="_self" />
<area id="negra3" alt="" title="negra3" onclick="sonido18.play()" shape="rect" coords="316,0,344,178" style="outline:none;" target="_self" />