0% found this document useful (0 votes)
7 views1 page

HTML 5 Elements (A1-1)

This HTML document creates a webpage that plays an MP3 audio file automatically. It includes an audio element with controls and a script that restarts the audio when it ends. The audio file is specified as 'example.mp3' and is set to play in a loop.

Uploaded by

cshinde000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

HTML 5 Elements (A1-1)

This HTML document creates a webpage that plays an MP3 audio file automatically. It includes an audio element with controls and a script that restarts the audio when it ends. The audio file is specified as 'example.mp3' and is set to play in a loop.

Uploaded by

cshinde000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

<!

DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Auto Play MP3</title>

</head>

<body>

<audio id="myAudio" controls autoplay onended="restartAudio()">

<source src="example.mp3" type="audio/mpeg">

Your browser does not support the audio element.

</audio>

<script>

function restartAudio() {

var audio = document.getElementById("myAudio");

audio.currentTime = 0;

audio.play();

</script>

</body>

</html>

You might also like