HTML Audio/Video DOM controls Property

❮ HTML Audio/Video DOM Reference

Example

//Accessing video element
var vid = document.getElementById("myVideo");

//Add controls
function enableControls() {
  vid.controls = true;
  vid.load();
}

//Remove controls
function disableControls() {
  vid.controls = false;
  vid.load();
}

//Check controls status
function checkControls() {
  alert(vid.controls);
}

Meaning

The controls property rets or returns whether the audio/video should display controls.


Standard Syntax

audio|video.controls=true|false



Browser Support




Status







Return Value

Type Description
true Specifies that controls are displayed
false Default. Specifies that controls are NOT displayed

Technical Details

Return Value: Boolean(true|false)
Default Value: false
❮ HTML Audio/Video DOM Reference