Back to Freecodecamp

Step 3

curriculum/challenges/english/blocks/workshop-cafe-menu/5f332b23c2045fb843337579.md

latest1.0 KB
Original Source

--description--

To let visitors know the cafe was founded in 2020, add a p element below the h1 element with the text Est. 2020.

--hints--

You should have an opening <p> tag.

js
assert.match(code, /<p>/i);

You should have a closing </p> tag.

js
assert.match(code, /<\/p>/i);

You should not change your existing h1 element. Make sure you did not delete the closing tag.

js
assert.lengthOf(document.querySelectorAll('h1'),1);

Your p element should be below your h1 element.

js
assert.equal(document.querySelector('p')?.previousElementSibling?.tagName, 'H1');

Your p element should have the text Est. 2020.

js
assert.equal(document.querySelector("p")?.innerText.trim(), "Est. 2020");

--seed--

--seed-contents--

html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>Cafe Menu</title>
  </head>
  <body>
    <main>
      <h1>CAMPER CAFE</h1>
--fcc-editable-region--
      
--fcc-editable-region--
    </main>
  </body>
</html>