--- title: HTMLMediaElement.muted slug: Web/API/HTMLMediaElement/muted translation_of: Web/API/HTMLMediaElement/muted ---
HTMLMediaElement.muted
表示媒体元素是否被静音。
var isMuted = audioOrVideo.muted audio.muted = true;
A {{domxref("Boolean")}}. true
表示被静音, false
表示未被静音。
var obj = document.createElement('video'); console.log(obj.muted); // false
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')}} |
{{Compat("api.HTMLMediaElement.muted")}}