dimanche 9 juin 2019

How to make sound when a or is clicked in JS

How can I make a sound ("MySound.mp3") when a <a> element or <button> element with the id "click_sound" is clicked in JavaScript, is it possible?

The Code:

<html>
<head></head>
<body>
<a id="click_sound">Click me</a>
<button id="click_sound">Click me</button>
</body>
</html>

The sound file name:
MySound.mp3

Aucun commentaire:

Enregistrer un commentaire