Audio muted Property - Find out if the sound is turned off: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Audio

Description

Audio muted Property - Find out if the sound is turned off:

Demo Code

ResultView the demo in separate window

<!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>

Related Tutorials