Back to Freecodecamp

Step 5

curriculum/challenges/english/blocks/workshop-balance-sheet/61fd6ab779390f49148773bb.md

latest1.3 KB
Original Source

--description--

Below your h1 element, create a div element. Give it an id attribute set to years. You want this particular element to be hidden from screen readers, so give it the aria-hidden attribute set to true.

--hints--

You should create a new div element after your h1 element.

js
assert.strictEqual(
  document.querySelector('h1')?.nextElementSibling?.localName,
  'div'
);

Your new div element should have an id attribute set to years.

js
assert.strictEqual(document.querySelector('div')?.getAttribute('id'), 'years');

Your new div element should have the aria-hidden attribute set to true.

js
assert.strictEqual(
  document.querySelector('div')?.getAttribute('aria-hidden'),
  'true'
);

--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>Balance Sheet</title>
    <link rel="stylesheet" href="./styles.css" />
  </head>
  <body>
    <main>
      <section>
        <h1>
          <span class="flex">
            <span>AcmeWidgetCorp</span>
            <span>Balance Sheet</span>
          </span>
        </h1>
--fcc-editable-region--

--fcc-editable-region--
      </section>
    </main>
  </body>
</html>
css