Javascript examples for DOM HTML Element:Embed
Playing sound when the button is pressed
<html> <head> <script language="javascript"> function playIt()/*from w ww . j a va 2 s. com*/ { document.getElementById("embed").innerHTML="<embed src='play.mp3' autostart=true loop=false volume=100 hidden=true>"; return true; } </script> </head> <body> <form action="" method="post"> <button type="button" onclick="playIt()">play</button> <div id="embed"></div> </form> </body> </html>