Javascript – playing sound file onMouseOver event


i want my sound file to play when some over mouse on my code is not working any one can help,if some 1 did this plz let me know the code.thanx in advance

function Sound(surl) {
    "<embed src='"+surl+"' hidden=true autostart=true loop=false>";

<span id=myspan></span>
<img src="imag.jpg" onMouseOver="Sound('success.wav')" />

Best Solution

<script type="text/javascript">
    function sound(surl) {
        document.getElementById("myspan").innerHTML =
        "<embed src="+surl+" hidden=true autostart=true loop=false>";

<span id="myspan"></span>

    <img src="image.jpg" onmouseover="sound('success.wav')" />


This has been tested and is working. May just want to change the cursor when you mouse over in CSS.