Javascript examples for jQuery Method and Property:trigger
Play Audio after loading
<html lang="en"> <head> <title>My audio test page</title> </head> //from w ww . j a v a 2 s .c om <body> <audio id="audio-cha-ching"> <source src="http://your file.wav" type="audio/wav"> </audio> <p>You should hear a "ka-ching" noise.</p> <script src="https://code.jquery.com/jquery-1.10.2.js"></script> <script type="text/javascript"> $(function(){ $("#audio-cha-ching").trigger("play"); }); </script> </body> </html>