Back to Content

HTMLMediaElement: controls property

files/en-us/web/api/htmlmediaelement/controls/index.md

latest621 B
Original Source

{{APIRef("HTML DOM")}}

The HTMLMediaElement.controls property reflects the controls HTML attribute, which controls whether user interface controls for playing the media item will be displayed.

Value

A boolean value. A value of true means controls will be displayed.

Examples

js
const obj = document.createElement("video");
obj.controls = true;

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • {{domxref("HTMLMediaElement")}}: Interface used to define the HTMLMediaElement.controls property