New in HTML5.

<audio autoplay> HTML Attribute

Sharing is caring!

Attribute of
New HTML Audio Element: Get Coding Now With Our Useful Tutorial
What does <audio autoplay> HTML Attribute do?
Specifies that the audio playback should begin immediately on page load.

Code Example

<audio controls  autoplay id="audio-example">
  <!-- One or more source files, each referencing the same audio but in a different file format.
    The browser will choose the first file which it is able to play. -->
   <source src="/wp-content/uploads/flamingos.ogg">
   <source src="/wp-content/uploads/flamingos.mp3">

    You will see this text if native audio playback is not supported.
    <!-- You could use this fall-back feature to insert a JavaScript-based audio player. -->

<small>Audio by  <a href="">Beeld en Geluid</a> [<a href="">CC BY-SA 3.0</a>], <a href="'s_-_SoundCloud_-_Beeld_en_Geluid.ogg">via Wikimedia Commons</a></small>

#audio-example {
display: block;
Audio by Beeld en Geluid [CC BY-SA 3.0], via Wikimedia Commons
Adam is a technical writer who specializes in developer documentation and tutorials.