Build an HTML Audio and Video Player - Build an HTML Audio and Video Player

Tell us what’s happening:

The errorshowing audio element should have a src attribute which i already assigned but still showing error. But its working for video element.

Your code so far

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  <title>HTML Audio and Video Lab</title>
</head>
<body>
  <h1>Audio & Video Lab</h1>
  <section>
    <h2>Video Playing</h2>
    <video controls width="640"> 
    <source src="https://cdn.freecodecamp.org/curriculum/labs/what-is-the-map-method-and-how-does-it-work.mp4" type="video/mp4">
    </video>
  </section>

  <section>
    <h2>Song Playing</h2>
    <audio controls loop> 
    <source src="https://cdn.freecodecamp.org/curriculum/js-music-player/we-are-going-to-make-it.mp3" type="audio/mpeg">
    
    </audio>
  </section>
</body>
</html>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36

Challenge Information:

Build an HTML Audio and Video Player - Build an HTML Audio and Video Player

I’ve edited your post to improve the readability of the code. When you enter a code block into a forum post, please precede it with three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add the backticks.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

Welcome to the forum @midhulaaugustine

Do audio elements use the source element?

Happy coding

in general yes, but in this lab no

are you asked to create a source element here? read carefully, it wants the src on the audio element not on the source element