2021-09-13 09:51:42 -07:00
|
|
|
---
|
|
|
|
id: 612e7d1c29fb872d6384379c
|
2021-10-21 10:07:52 -07:00
|
|
|
title: Step 4
|
2021-09-13 09:51:42 -07:00
|
|
|
challengeType: 0
|
2021-10-21 10:07:52 -07:00
|
|
|
dashedName: step-4
|
2021-09-13 09:51:42 -07:00
|
|
|
---
|
|
|
|
|
|
|
|
# --description--
|
|
|
|
|
|
|
|
Nest a second `div` within your existing `div`, and set the `class` to be `keys`.
|
|
|
|
|
|
|
|
# --hints--
|
|
|
|
|
|
|
|
You should create a second `div` element.
|
|
|
|
|
|
|
|
```js
|
|
|
|
const divDiv = document.querySelectorAll('div');
|
|
|
|
assert(divDiv?.length === 2);
|
|
|
|
```
|
|
|
|
|
|
|
|
Your new `div` element should be within your existing `div` element.
|
|
|
|
|
|
|
|
```js
|
|
|
|
const div = document.querySelector('div');
|
|
|
|
assert(div?.children?.length === 1);
|
|
|
|
assert(div?.children?.[0]?.localName === 'div');
|
|
|
|
```
|
|
|
|
|
|
|
|
Your new `div` element should have the `class` set to `keys`.
|
|
|
|
|
|
|
|
```js
|
|
|
|
const div = document.querySelector('div');
|
|
|
|
assert(div?.children?.[0]?.className === 'keys');
|
|
|
|
```
|
|
|
|
|
|
|
|
# --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>
|
|
|
|
<div id="piano">
|
|
|
|
--fcc-editable-region--
|
|
|
|
|
|
|
|
--fcc-editable-region--
|
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
```
|
|
|
|
|
|
|
|
```css
|
|
|
|
|
|
|
|
```
|