Javascript examples for DOM HTML Element:Embed
Add new <embed> element to play mp3 file
<html> <head> <script language="javascript" type="text/javascript"> function Sound(surl) {//from ww w . ja va2s . com console.log("working"); document.getElementById("myspan").innerHTML= "<embed src='http://your file.mp3' hidden='true' autostart='true' loop='false' />"; } </script> </head> <body> <span id="myspan"></span> <form> <img src="http://www.java2s.com/style/download.png" onMouseOver="Sound('success.wav')"> </form> </body> </html>