Audio muted attribute
Definition and Usage
muted
Attribute that sets or returns whether the audio output should be muted (sound off).
This attribute reflects <audio> muted attribute.
When set, it specifies that the audio output should be muted.
Example
Example 1
Turn off the sound:
document.getElementById("myAudio").muted = true;
Example 2
Check if the sound is off:
var x = document.getElementById("myAudio").muted;
Syntax
Return the muted attribute:
audioObject.muted
Set the muted attribute:
audioObject.muted = true|false
attribute value
value | description |
---|---|
true|false |
Specifies whether the audio output should be muted.
|
Technical Details
Return Value: | Boolean value, returns true if the audio output is muted, otherwise returns false. |
---|---|
Default Value: | false |
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support |
Related Pages
HTML Reference Manual:HTML <audio> muted Attribute