Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Audio muted attribute

Audio muted attribute

Audio Object Reference Audio object

Example

Turn off the audio:

document.getElementById("myAudio").muted = true;

Try it »


Definition and Usage

The muted attribute sets or returns whether the audio should be muted (sound turned off).

This property reflects

This attribute specifies that the audio is muted.

Note:


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the muted attribute.

Note: Internet Explorer 8 and earlier IE versions are not supported.


Syntax

Return the muted attribute:

audioObject

.muted

Set the muted attribute:

audioObject

.muted=true|false

Attribute values

Value Description
true|false Specifies whether the output audio is muted:
  • true - indicates that the audio sound should be turned off.
  • false - default. Indicates that the audio sound should be turned on.
  • |

    Technical Details

    Return Value: Boolean. Returns true if the audio output is muted, otherwise false.
    Default Value: false

    More examples

    Example

    Check whether the sound is turned off:

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

    x

    The output is:

    true

    Try it »


    Related pages

    HTML Reference Manual: HTML


    Audio Object Reference Audio object