--- title: HTMLMediaElement.muted slug: Web/API/HTMLMediaElement/muted translation_of: Web/API/HTMLMediaElement/muted ---
{{APIRef("HTML DOM")}}

HTMLMediaElement.muted 表示媒体元素是否被静音。

Syntax

var isMuted = audioOrVideo.muted
audio.muted = true;

Value

A {{domxref("Boolean")}}. true 表示被静音, false 表示未被静音。

Example

var obj = document.createElement('video');
console.log(obj.muted); // false

Specifications

Specification Status Comment
{{SpecName('HTML WHATWG', "#dom-media-muted", "HTMLMediaElement.muted")}} {{Spec2('HTML WHATWG')}}  
{{SpecName('HTML5 W3C', "embedded-content-0.html#htmlmediaelement", "HTMLMediaElement.muted")}} {{Spec2('HTML5 W3C')}}  

Browser compatibility

{{Compat("api.HTMLMediaElement.muted")}}

See also