Javascript examples for jQuery:Mouse Event
Javascript delay on audio play on click
<html lang="en"> <head> <title> Dan Kreiger</title> </head> /*from ww w .ja v a 2 s . c o m*/ <body translate="no"> <button class="but">sound here</button> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function() { var blue = new Audio("https://your file.mp3"); $(".but").on("click", function() { blue.play(); }); }); </script> </body> </html>