curriculum/challenges/english/blocks/learn-html-by-building-a-cat-photo-app/5efae0543cbd2bbdab94e333.md
To improve accessibility of the image you added, add an alt attribute with the text:
Two tabby kittens sleeping together on a couch.
Your figure element should have an opening tag. Opening tags have this syntax: <elementName>.
assert(document.querySelectorAll('figure').length === 2);
Your figure element should have a closing tag. Closing tags have a / just after the < character.
assert(code.match(/<\/figure>/g).length === 2);
There should be a figure element right above the last section element's closing tag.
assert.strictEqual(document.querySelectorAll('main > section')?.[1]?.lastElementChild?.nodeName, 'FIGURE');
The Cats img element should be nested in the figure element.
const catsImg = document.querySelectorAll('figure > img')[1];
assert.exists(catsImg);
The third image should have a src attribute set to https://cdn.freecodecamp.org/curriculum/cat-photo-app/cats.jpg.
const catsImg = document.querySelectorAll('figure > img')[1];
assert.strictEqual(
catsImg?.src?.toLowerCase(), 'https://cdn.freecodecamp.org/curriculum/cat-photo-app/cats.jpg'
);
The Cats img element should have an alt attribute with the value Two tabby kittens sleeping together on a couch.
const catsImg = document.querySelectorAll('figure > img')[1];
assert.match(catsImg?.getAttribute('alt')?.replace(/\s+/g, ' '), /^Two tabby kittens sleeping together on a couch..?$/i);
<html>
<body>
<main>
<h1>CatPhotoApp</h1>
<section>
<h2>Cat Photos</h2>
<p>Everyone loves <a href="https://cdn.freecodecamp.org/curriculum/cat-photo-app/running-cats.jpg">cute cats</a> online!</p>
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
<a href="https://freecatphotoapp.com"></a>
</section>
<section>
<h2>Cat Lists</h2>
<h3>Things cats love:</h3>
<ul>
<li>catnip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<figure>
<figcaption>Cats <em>love</em> lasagna.</figcaption>
</figure>
<h3>Top 3 things cats hate:</h3>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
<figure>
--fcc-editable-region--
--fcc-editable-region--
</figure>
</section>
</main>
</body>
</html>