Javascript examples for jQuery Method and Property:on
Javascript $(document).on('click')
<html> <head></head> <body> <h1> hello </h1> <audio id="audio"> <source src="http://your mp3 file" type="audio/aac"> </audio> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <script type="text/javascript"> function dosomething(){// w w w. ja va2 s . c o m $('body').append('document click<br />'); document.getElementById('audio').play();}; $(document).on('click', function(){dosomething()}); </script> </body> </html>