How to add a sound alert for message notification in javascript?

Added sample to display message notification. When we show it, we need to add a beep. This almost mimics a behavior similar to a desktop alert.

Anyone have a solution?

+4
source share
1 answer

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"> 
+4
source

Source: https://habr.com/ru/post/1442290/


All Articles