Javascript examples for DOM HTML Element:Audio
Audio muted Property - Find out if the sound is turned off:
<!DOCTYPE html> <html> <body> <audio id="myAudio" controls muted> <source src="your.ogg" type="audio/ogg"> <source src="your.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio><br> <p>Click the button to find out if the sound is on mute.</p> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {//from w w w. j a v a 2 s. c o m var x = document.getElementById("myAudio").muted; document.getElementById("demo").innerHTML = x; } </script> </body> </html>