English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The autoplay property is a boolean property, the autoplay property specifies that the audio should start playing as soon as it is ready. If this property is set, the audio will play automatically
The audio file will start playing automatically:
!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>HTML:<audio> autoplay property-Basic Tutorial Website(oldtoolbag.com)</title> </head> <body> <audio controls autoplay> <source src="horse.ogg" type="audio/ogg"> <source src="horse.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> </body> </html>Test and see ‹/›
IEFirefoxOperaChromeSafari
Internet Explorer 9+, Firefox, Opera, Chrome, and Safari browsers support the autoplay attribute.
Note: Internet Explorer 8 and earlier versions do not support the <audio> tag.
The autoplay attribute is a boolean attribute
The autoplay attribute specifies that the audio should start playing as soon as it is ready.
If this attribute is set, the audio will play automatically.
The autoplay attribute is in HTML 5 new attributes.
In XHTML, this attribute is not allowed to be abbreviated, the autoplay attribute must be defined as <audio autoplay="autoplay">.
<audio autoplay>