Easy Tutorial
❮ Event Onbeforeprint Jsref Toisostring ❯

Video controls Attribute

Video Object

Example

Enable video controls:

document.getElementById("myVideo").controls = true;

Definition and Usage

The controls attribute sets or returns whether the browser should display the standard video controls.

This attribute reflects the <video> controls attribute.

When used, it specifies that video controls should be displayed.

Video controls include:

Note: The <video> element is new in HTML5.


Browser Support

All major browsers support the controls attribute.

Note: The <video> element is not supported in Internet Explorer 8 and earlier versions.


Syntax

Return the controls attribute:

Set the controls attribute:

Attribute Values

Value Description
true false Specifies whether to display video controls: true - Specifies to display controls<br> false - Default. Specifies not to display controls

Technical Details

Return Value: Boolean, returns true if video controls are displayed, otherwise returns false.
Default Value: false
--- ---

More Examples

Example

Check if video controls are displayed:

var x = document.getElementById("myVideo").controls;
true

Example

Enable, disable, and check controls status:

var x = document.getElementById("myVideo");
function enableControls() {
    x.controls = true;
    x.load();
}
function disableControls() {
    x.controls = false;
    x.load();
}
function checkControls() {
    alert(x.controls);
}

Related Pages

HTML Reference: HTML <video> controls Attribute


❮ Event Onbeforeprint Jsref Toisostring ❯