1.3 KiB
1.3 KiB
id | title | challengeType | dashedName |
---|---|---|---|
5dc17d3bf86c76b9248c6eb4 | Passo 3 | 0 | step-3 |
--description--
O elemento p
é usado para criar um parágrafo de texto nos sites. Crie um elemento p
abaixo do elemento h2
e dê a ele o seguinte texto:
Click here to view more cat photos
--hints--
O elemento p
deve ter uma tag de abertura. As tags de abertura têm a seguinte sintaxe: <elementName>
.
assert(document.querySelector('p'));
Seu elemento p
deve ter uma tag de fechamento. As tags de fechamento têm um caractere /
logo após o caractere <
.
assert(code.match(/<\/p\>/));
O texto do seu elemento p
deve ser Click here to view more cat photos.
Você omitiu o texto ou tem um erro de digitação.
const extraSpacesRemoved = document
.querySelector('p')
.innerText.replace(/\s+/g, ' ');
assert(extraSpacesRemoved.match(/click here to view more cat photos\.?$/i));
O elemento p
deve estar abaixo do elemento h2
. Eles estão na ordem errada.
const collection = [...document.querySelectorAll('h2,p')].map(
(node) => node.nodeName
);
assert(collection.indexOf('H2') < collection.indexOf('P'));
--seed--
--seed-contents--
<html>
<body>
<h1>CatPhotoApp</h1>
--fcc-editable-region--
<h2>Cat Photos</h2>
--fcc-editable-region--
</body>
</html>