2022-06-06 14:55:35 +00:00
|
|
|
---
|
|
|
|
id: 612e7d1c29fb872d6384379c
|
|
|
|
title: Step 4
|
|
|
|
challengeType: 0
|
|
|
|
dashedName: step-4
|
|
|
|
---
|
|
|
|
|
|
|
|
# --description--
|
|
|
|
|
|
|
|
Annida un secondo `div` all'interno del `div` esistente e assegna all'attributo `class` il valore `keys`.
|
|
|
|
|
|
|
|
# --hints--
|
|
|
|
|
|
|
|
Dovresti creare un secondo elemento `div`.
|
|
|
|
|
|
|
|
```js
|
|
|
|
const divDiv = document.querySelectorAll('div');
|
|
|
|
assert(divDiv?.length === 2);
|
|
|
|
```
|
|
|
|
|
|
|
|
Il nuovo elemento `div` dovrebbe essere all'interno dell'elemento `div` esistente.
|
|
|
|
|
|
|
|
```js
|
|
|
|
const div = document.querySelector('div');
|
|
|
|
assert(div?.children?.length === 1);
|
|
|
|
assert(div?.children?.[0]?.localName === 'div');
|
|
|
|
```
|
|
|
|
|
|
|
|
Il nuovo elemento `div` dovrebbe avere l'attributo `class` con il valore `keys`.
|
|
|
|
|
|
|
|
```js
|
|
|
|
const div = document.querySelector('div');
|
|
|
|
assert(div?.children?.[0]?.className === 'keys');
|
|
|
|
```
|
|
|
|
|
|
|
|
# --seed--
|
|
|
|
|
|
|
|
## --seed-contents--
|
|
|
|
|
|
|
|
```html
|
|
|
|
<!DOCTYPE html>
|
2022-06-30 15:24:09 +00:00
|
|
|
<html lang="en">
|
2022-06-06 14:55:35 +00:00
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8" />
|
|
|
|
<title>Piano</title>
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div id="piano">
|
|
|
|
--fcc-editable-region--
|
|
|
|
|
|
|
|
--fcc-editable-region--
|
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
```
|
|
|
|
|
|
|
|
```css
|
|
|
|
|
|
|
|
```
|