HTML DOM Audio controls property
Definition and Usage
controls property sets or returns the browser should display the standard audio and video controls.
This property reflects the <audio> Control Properties.
If the attribute is present, it specifies the display of audio controls.
Audio and video controls include:
- Broadcast
- time out
- progress bar
- volume
Note: <audio> elements in HTML5 is newly added.
Browser Support
All major browsers support controls property.
Note: Internet Explorer 8 or earlier browser does not support the <audio> Properties.
grammar
Returns controls properties:
audioObject .controls
Setting controls properties:
audioObject .controls=true|false
Property Value
值 | 描述 |
---|---|
true|false | 指定音频是否显示控件。
|
technical details
return value: | Boolean value that, if the audio setting display control returns true, otherwise it returns false. |
---|---|
Defaults: | false |
More examples
Examples
Check whether the audio controls appear:
var x = document.getElementById("myAudio").controls;
x The output is:
true
try it"
related articles
HTML Reference Manual: HTML <Audio> Controls property
Audio Object