HTML autoplay Attribute


The HTML autoplay attribute is a boolean attribute that, when specified, indicates that the audio or video should start playing as soon as it is ready, without waiting for the entire file to download. It can be used on both <audio> and <video> tags. The primary use of autoplay is to provide a seamless media experience for the user by eliminating the need to manually start playback of a media file. However, its use is subject to various restrictions by browsers, primarily to improve user experience and prevent unexpected audio or video playbacks that could be intrusive. For example, many mobile browsers and some desktop browsers will ignore the autoplay attribute unless the video is muted, or unless the user has interacted with the site in some way. This is because automatic playback with sound can be disruptive or consume data on a mobile plan. To ensure compatibility and adherence to user preferences, developers often need to combine autoplay with other attributes like muted or use JavaScript to control media playback more dynamically.


<tagname autoplay>


The autoplay attribute is a boolean attribute, therefore no values are associated with this attribute.

Applies To

The autoplay attribute can be used on the following html elements.


<audio autoplay controls><source src="audio/chime.mp3" type="audio/mpeg">Sorry your browser does not support the audio tag.</audio>
<p>To see this attribute in action, please click on 'Editor'</p>

Browser Support

The following table will show you the current browser support for the HTML autoplay Attribute.

Edge Chrome Firefox Opera Safari
Tablets / Mobile
Chrome Firefox Opera Safari Samsung Webview

Last updated by CSSPortal on: 29th March 2024