Audio muted 属性
实例
例子 1
关闭声音:
document.getElementById("myAudio").muted = true;
例子 2
查看声音是否关闭:
var x = document.getElementById("myAudio").muted;
语法
返回 muted 属性:
audioObject.muted
设置 muted 属性:
audioObject.muted = true|false
属性值
值 | 描述 |
---|---|
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