Javascript examples for DOM:Mouse Event
playing sound file onMouseOver event
<html> <head> <script language="javascript" type="text/javascript"> function Sound(surl) {//from ww w .j a v a 2s .c om 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>