05 / 12

What is the controls attribute in video and audio elements?

Difficulty: 3/10
media elements, accessibility, user interaction

In HTML, the controls attribute is used with <video> and <audio> elements. It tells the browser to display built-in playback controls, such as play, pause, volume, and seek bar, so users can interact with the media.

Key Points about the controls Attribute
  1. 1

    It works with both <video> and <audio> elements.

  2. 2

    When present, it shows the browser’s default player interface (play/pause button, timeline, volume, etc.).

  3. 3

    It is a Boolean attribute — meaning you don’t need to assign it a value (just writing controls is enough).

  4. 4

    Without controls, the media can only be controlled through JavaScript or autoplay.

Example Usage

In short: The controls attribute makes media interactive by showing play, pause, volume, and other basic controls to the user.

Scenario Questions

Share

Share via WhatsApp, X, Facebook, LinkedIn or copy link. Open Graph preview enabled.