How can we add beep sound for message notification in javascript?

Added sample to show message notification.Whenever we show it we have to add beep sound. Almost it imitates the behavior like desktop alert.

Can anyone have solution ?

Upvotes: 4

Views: 7231

Answers (1)

Om3ga
Om3ga

Reputation: 32941

this should help

<script>
    function PlaySound(soundObj) {
        var sound = document.getElementById(soundObj);
        sound.Play();
    }
</script>

<embed src="success.wav" autostart="false" width="0" height="0" id="sound1" enablejavascript="true">

Upvotes: 4

Related Questions