curriculum/challenges/english/blocks/workshop-cat-photo-app/5dc1798ff86c76b9248c6eb3.md
Below the h1 element, add an h2 element with this text:
Cat Photos
Your h1 element should have an opening tag. Opening tags have this syntax: <elementName>.
assert.exists(document.querySelector('h1'));
Your h1 element should have a closing tag. Closing tags have this syntax: </elementName>.
assert.match(code, /<\/h1\>/);
You should only have one h1 element. Remove the extra.
assert.lengthOf(document.querySelectorAll('h1'), 1);
Your h1 element's text should be 'CatPhotoApp'. You have either omitted the text or have a typo.
assert.equal(document.querySelector('h1')?.innerText?.trim().toLowerCase(), 'catphotoapp');
Your h2 tags should be in lowercase. By convention, all HTML tags are written in lowercase.
assert.notMatch(code, /<\/?H2>/);
Your h2 element should have an opening tag. Opening tags have this syntax: <elementName>.
assert.exists(document.querySelector('h2'));
Your h2 element should have a closing tag. Closing tags have a / just after the < character.
assert.match(code, /<\/h2\>/);
Your h2 element's text should be Cat Photos. Only place the text Cat Photos between the opening and closing h2 tags.
assert.equal(document.querySelector('h2')?.innerText?.trim().replace(/\s+/g, ' ').toLowerCase(), 'cat photos');
Your h2 element should be below the h1 element. The h1 element has greater importance and must be above the h2 element.
const collection = [...document.querySelectorAll('h1,h2')].map(
(node) => node.nodeName
);
assert.isBelow(collection.indexOf('H1'), collection.indexOf('H2'));
<html>
<body>
<h1>CatPhotoApp</h1>
--fcc-editable-region--
--fcc-editable-region--
</body>
</html>