How to play a sound when an element is clicked in HTML page
In this example we will demonstrate how to play a "click" sound when a link or other element is clicked in HTML pages. A sample code for jQueryMobile is also provided. An MP3 audio file is used play the actual sound. You have to have jQuery in your page for this to work.
Sound is played through HTML5 <audio /> tag but instead of embedding the tag manually, the tag is created via Javascript/JQuery. Below is how this is done.