2021-09-13 09:51:42 -07:00
|
|
|
---
|
|
|
|
id: 612e804c54d5e7308d7ebe56
|
2021-10-21 10:07:52 -07:00
|
|
|
title: Step 5
|
2021-09-13 09:51:42 -07:00
|
|
|
challengeType: 0
|
2021-10-21 10:07:52 -07:00
|
|
|
dashedName: step-5
|
2021-09-13 09:51:42 -07:00
|
|
|
---
|
|
|
|
|
|
|
|
# --description--
|
|
|
|
|
|
|
|
Within your `.keys` element, add seven `div` elements. Give them all the class `key`.
|
|
|
|
|
|
|
|
# --hints--
|
|
|
|
|
|
|
|
You should create seven new `div` elements.
|
|
|
|
|
|
|
|
```js
|
|
|
|
const divDivDiv = document.querySelectorAll('div');
|
|
|
|
assert(divDivDiv?.length === 9);
|
|
|
|
```
|
|
|
|
|
|
|
|
Your seven new `div` elements should be within your `.keys` element.
|
|
|
|
|
|
|
|
```js
|
|
|
|
const keys = document.querySelector('.keys');
|
|
|
|
assert([...keys?.children].length === 7);
|
|
|
|
assert([...keys?.children].every(child => child?.tagName === 'DIV'));
|
|
|
|
```
|
|
|
|
|
|
|
|
Your seven new `div` elements should all have the `class` set to `key`.
|
|
|
|
|
|
|
|
```js
|
|
|
|
const keys = document.querySelector('.keys');
|
|
|
|
assert([...keys?.children].every(child => child?.classList?.contains('key')));
|
|
|
|
```
|
|
|
|
|
|
|
|
# --seed--
|
|
|
|
|
|
|
|
## --seed-contents--
|
|
|
|
|
|
|
|
```html
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8" />
|
2022-03-14 15:54:43 +00:00
|
|
|
<title>Piano</title>
|
2021-09-13 09:51:42 -07:00
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
--fcc-editable-region--
|
|
|
|
<div id="piano">
|
|
|
|
<div class="keys"></div>
|
|
|
|
</div>
|
|
|
|
--fcc-editable-region--
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
```
|
|
|
|
|
|
|
|
```css
|
|
|
|
|
|
|
|
```
|