Back to Freecodecamp

Step 2

curriculum/challenges/english/blocks/workshop-html-music-player/698c4f4e965bd853ad5084e1.md

latest1.2 KB
Original Source

--description--

Below the h1, add an h2 element with the text Can't Stay Down, this is the title of the first song.

Below the h2 element add a p element with the text Artist: Quincy Larson.

--hints--

You should have an h2 element.

js
assert.exists(document.querySelector('h2'));

Your h2 element should be below the h1 element.

js
assert.exists(document.querySelector('h1 + h2'));

Your h2 element should contain the text Can't Stay Down.

js
const h2 = document.querySelector('h2');
assert.strictEqual(h2?.textContent.trim(), "Can't Stay Down");

You should have a p element.

js
assert.exists(document.querySelector('p'));

Your p element should contain the text Artist: Quincy Larson.

js
const p = document.querySelector('p');
assert.strictEqual(p?.textContent.trim(), 'Artist: Quincy Larson');

--seed--

--seed-contents--

html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Working with the HTML Audio Element</title>
</head>
<body>
  <h1>freeCodeCamp Tunes</h1>

--fcc-editable-region--
  
--fcc-editable-region--

</body>
</html>