HTML | autoplay Attribute
The HTML autoplay Attribute is used to specify that the audio/video should automatically start playing when web page is loaded. It is a Boolean attribute.
Syntax:
Attention reader! Dont stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML course.
Uses It can be used with and element.
Example 1: Here the autoplay attribute is used with the tag.
HTML video autoplay Attribute
GeeksforGeeksHTML video autoplay Attribute |
Output:
Example 2: Here the autoplay attribute is used with the tag.
HTML audio autoplay Attribute
GeeksforGeeks
HTML audio autoplay Attribute |
Output:
Supported Browsers: The browser supported by HTML autoplay attribute are listed below:
- Google Chrome 4.0
- Internet Explorer 9.0
- Firefox 3.5
- Safari 4.0
- Opera 10.5