Audio controls Property
Example
Enable controls for an audio:
document.getElementById("myAudio").controls = true;
Try it Yourself »
Description
The controls property sets or returns whether a audio should display standard audio controls.
This property reflects the <audio> controls attribute.
When present, it specifies that the audio controls should be displayed.
Audio controls should include:
- Play
- Pause
- Seeking
- Volume
Browser Support
Property | |||||
---|---|---|---|---|---|
controls | Yes | Yes | Yes | Yes | Yes |
Syntax
Return the controls property:
audioObject.controls
Set the controls property:
audioObject.controls = true|false
Property Values
Value | Description |
---|---|
true|false | Specifies whether a audio should have controls displayed, or not
|
Technical Details
Return Value: | A Boolean, returns true if audio controls are displayed, otherwise it returns false |
---|---|
Default Value: | false |
More Examples
Example
Find out if the audio controls are displayed:
var x = document.getElementById("myAudio").controls;
Try it Yourself »
Related Pages
HTML reference: HTML <audio> controls attribute
❮ Audio Object
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.