2022-05-12 16:20:24 +00:00
|
|
|
---
|
|
|
|
id: 5f344fbc22624a2976425065
|
2022-10-18 07:29:49 +00:00
|
|
|
title: Step 9
|
2022-05-12 16:20:24 +00:00
|
|
|
challengeType: 0
|
2022-10-18 07:29:49 +00:00
|
|
|
dashedName: step-9
|
2022-05-12 16:20:24 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
# --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>
|
2022-06-28 13:30:45 +00:00
|
|
|
<html lang="en">
|
2022-05-12 16:20:24 +00:00
|
|
|
<head>
|
|
|
|
<meta charset="utf-8" />
|
|
|
|
<title>Cafe Menu</title>
|
|
|
|
</head>
|
|
|
|
<body>
|
2022-10-18 07:29:49 +00:00
|
|
|
<main>
|
2022-10-11 18:26:51 +00:00
|
|
|
<h1>CAMPER CAFE</h1>
|
|
|
|
<p>Est. 2020</p>
|
2022-05-12 16:20:24 +00:00
|
|
|
--fcc-editable-region--
|
|
|
|
<section>
|
|
|
|
</section>
|
|
|
|
--fcc-editable-region--
|
|
|
|
</main>
|
|
|
|
</body>
|
2022-06-28 13:30:45 +00:00
|
|
|
</html>
|
2022-05-12 16:20:24 +00:00
|
|
|
```
|