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;

Try it yourself

Example 2

Check if the sound is off:

var x = document.getElementById("myAudio").muted;

Try it yourself

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.

  • true - Indicates that the sound should be turned off for the audio
  • false - Default. Indicates that the sound should be turned on for the audio

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