Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML Audio/Video DOM controls Property

HTML Audio/Video DOM controls Property

HTML audio/video Tag Reference HTML Audio/Video DOM Reference

Example

Enable controls for the video:

myVid=document.getElementById("video1");

myVid.controls=true;

Try it »


Definition and Usage

The controls property sets or returns whether the browser should display standard audio/video controls.

Standard audio/video controls include:


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the controls attribute.

**Note:** Internet Explorer 8 and earlier versions do not support this property.


Syntax

Set the controls attribute:

audio|video

.controls=true|false

Return the controls attribute:

audio|video

.controls

Attribute values

Value Description
true Indicates that controls are displayed.
false Default. Indicates that controls are not displayed.

Technical Details

Return Value: Boolean value, true|false
Default value: false

HTML audio/video Tag Reference HTML Audio/Video DOM Reference