The autoplay is an
audio tag attribute. It is only supported by HTML5.
When it is present in audio tag, the music file will begin itself.
or
After loading web page, music will start automatically .
| Attribute | Value | Description |
| autoplay | Boolean | If it is presented in audio tag. Music will start itself. |
Declaration syntax of autoplay attribute in HTML5.
| <audio src="URL" autoplay controls>Content</audio> |
|
<!DOCTYPE html > <html > <head> <title>Audio Tag </title> </head> <body> <p><b>Example of audio tag in HTML5.</b></p> <audio autoplay controls> <source src="a1.mp3" type="audio/mp3" /> Browser does not support audio tag. </audio> </body> </html> |
The audio tag is only available in HTML5. It is not available in HTML4.01.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.