Javascript examples for DOM:Element innerHTML
Create new element by assigning html string to innerHTML
<html> <head> <script language="javascript"> function playIt()/*from w ww . j av a 2s.c o m*/ { 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>