VOOZH about

URL: https://www.geeksforgeeks.org/html/html-controls-attribute/

⇱ HTML controls Attribute - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML controls Attribute

Last Updated : 29 May, 2026

The HTML controls attribute is used with media elements such as <audio> and <video> to display built-in playback controls. It allows users to play, pause, adjust volume, and interact with the media directly.

  • Adds default media controls to audio and video elements.
  • Enables users to play, pause, seek, and adjust volume.
  • Commonly used with the <audio> and <video> tags.

Syntax:

<element controls> 

Below example illustrates the use of controls attribute in <audio> element.

Example: Use the <audio> element with controls and autoplay attributes to play an audio file. It includes multiple <source> elements for different audio formats.

Example: Use the <video> element with controls to embed a video player. It includes <source> elements for multiple video formats, ensuring compatibility across different browsers.

Comment
Article Tags: