71 lines
1.2 KiB
Markdown
71 lines
1.2 KiB
Markdown
|
---
|
||
|
id: 5f344fbc22624a2976425065
|
||
|
title: Step 10
|
||
|
challengeType: 0
|
||
|
dashedName: step-10
|
||
|
---
|
||
|
|
||
|
# --description--
|
||
|
|
||
|
Crea un elemento `h2` con il testo `Coffee` all'interno dell'elemento `section`.
|
||
|
|
||
|
# --hints--
|
||
|
|
||
|
Dovresti avere un tag di apertura `<h2>`.
|
||
|
|
||
|
```js
|
||
|
assert(code.match(/<h2\s*>/i));
|
||
|
```
|
||
|
|
||
|
Dovresti avere un tag di chiusura `</h2>`.
|
||
|
|
||
|
```js
|
||
|
assert(code.match(/<\/h2\s*>/i));
|
||
|
```
|
||
|
|
||
|
Non dovresti cambiare l'elemento `section` esistente. Assicurati di non aver eliminato il tag di chiusura.
|
||
|
|
||
|
```js
|
||
|
assert($('section').length === 1);
|
||
|
```
|
||
|
|
||
|
L'elemento `h2` dovrebbe essere all'interno dell'elemento `section`.
|
||
|
|
||
|
```js
|
||
|
const h2 = document.querySelector('h2');
|
||
|
assert(h2.parentElement.tagName === 'SECTION');
|
||
|
```
|
||
|
|
||
|
L'elemento `h2` dovrebbe contenere il testo `Coffee`.
|
||
|
|
||
|
```js
|
||
|
const h2 = document.querySelector('h2');
|
||
|
assert(h2.innerText === 'Coffee');
|
||
|
```
|
||
|
|
||
|
# --seed--
|
||
|
|
||
|
## --seed-contents--
|
||
|
|
||
|
```html
|
||
|
<!DOCTYPE html>
|
||
|
<html>
|
||
|
<head>
|
||
|
<meta charset="utf-8" />
|
||
|
<title>Cafe Menu</title>
|
||
|
</head>
|
||
|
<body>
|
||
|
<header>
|
||
|
<h1>CAMPER CAFE</h1>
|
||
|
<p>Est. 2020</p>
|
||
|
</header>
|
||
|
<main>
|
||
|
--fcc-editable-region--
|
||
|
<section>
|
||
|
</section>
|
||
|
--fcc-editable-region--
|
||
|
</main>
|
||
|
</body>
|
||
|
<html>
|
||
|
```
|