I've struggled some time to find a working way of playing a sound when a linked is clicked on, and finally came up with the following:
<audio id="sound0" src="/sounds/foo">
<a href="javascript:play('sound0');">Click here</a>
<script>function play(sound_id) {
document.getElementById(sound_id).play();
}</script>
Now, this works fine, but only the first time the link is clicked on; after that, clicking again on it doesn't have any effect.
How can I fix this?