Back to Freecodecamp

Step 2

curriculum/challenges/english/blocks/workshop-nutritional-label/615f2d4150fe0d4cbd0f2628.md

latest931 B
Original Source

--description--

Below your h1 element, add a p element with the text 8 servings per container.

--hints--

You should add a new p element.

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

Your p element should be within your body element.

js
assert.equal(document.querySelector('p')?.parentElement?.localName, 'body');

Your p element should come after your h1 element.

js
assert.equal(document.querySelector('p')?.previousElementSibling?.localName, 'h1');

Your p element should have the text 8 servings per container.

js
assert.equal(document.querySelector('p')?.innerText, '8 servings per container');

--seed--

--seed-contents--

html
--fcc-editable-region--
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>Nutrition Label</title>
</head>

<body>
  <h1>Nutrition Facts</h1>
    
</body>
</html>
--fcc-editable-region--
css