Latest web development tutorials

HTML DOM Audio muted property

Audio Object Reference Audio Object

Examples

Close Audio:

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

try it"

Definition and Usage

muted property sets or returns whether the audio should be muted (turn off the sound).

This property reflects the <audio> muted property.

This attribute specifies the audio is muted.

Note: <audio> elements in HTML5 is new.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the muted property.

Note: Internet Explorer 8 and earlier versions of IE do not support the <audio> element.


grammar

Back muted attributes:

audioObject .muted

Setting muted properties:

audioObject .muted=true|false

Property Value

描述
true|false 指定输出音频是否静音:
  • true - 指示应该关闭音频的声音。
  • false - 默认。指示打开音频的声音。

technical details

return value: Boolean value that, if the audio output is muted returns true, otherwise returns false.
Default Value: false


More examples

Examples

Detecting whether the sound off:

var x = document.getElementById ( "myAudio") muted.;
x The output is:
true

try it"


Related Pages

HTML Reference Manual: HTML <Audio> the muted property


Audio Object Reference Audio Object