Audio autoplay HTML

HTML

The autoplay attribute on an

Audio autoplay HTML

Example

#

An autoplay attribute on an

Audio autoplay HTML
copy
copied to clipboard
Try it live

Using autoplay

#

The autoplay attribute specifies that the audio player starts when the page is loaded.

With this attribute, the audio file will start playing even before the entire file is loaded.

Tip: Automatically playing an audio file may surprise users because they are not expecting it.
It is usually best to give the users full control over when to start.


Syntax

#