2021-10-14 23:33:13 +01:00
|
|
|
---
|
|
|
|
id: 60f027c87bc98f050395c139
|
2021-10-21 10:07:52 -07:00
|
|
|
title: Step 3
|
2021-10-14 23:33:13 +01:00
|
|
|
challengeType: 0
|
2021-10-21 10:07:52 -07:00
|
|
|
dashedName: step-3
|
2021-10-14 23:33:13 +01:00
|
|
|
---
|
|
|
|
|
|
|
|
# --description--
|
|
|
|
|
|
|
|
Next, add opening and closing `head` and `body` tags within the `html` element.
|
|
|
|
|
|
|
|
# --hints--
|
|
|
|
|
|
|
|
You should have an opening `head` tag.
|
|
|
|
|
|
|
|
```js
|
|
|
|
assert(code.match(/<head\s*>/i));
|
|
|
|
```
|
|
|
|
|
|
|
|
You should have a closing `head` tag.
|
|
|
|
|
|
|
|
```js
|
|
|
|
assert(code.match(/<\/head\s*>/i));
|
|
|
|
```
|
|
|
|
|
|
|
|
You should have an opening `body` tag.
|
|
|
|
|
|
|
|
```js
|
|
|
|
assert(code.match(/<body\s*>/i));
|
|
|
|
```
|
|
|
|
|
|
|
|
You should have a closing `body` tag.
|
|
|
|
|
|
|
|
```js
|
|
|
|
assert(code.match(/<\/body\s*>/i));
|
|
|
|
```
|
|
|
|
|
|
|
|
The `head` and `body` elements should be siblings.
|
|
|
|
|
|
|
|
```js
|
|
|
|
assert(document.querySelector('head')?.nextElementSibling.localName === 'body');
|
|
|
|
```
|
|
|
|
|
|
|
|
The `head` element should be within the `html` element.
|
|
|
|
|
|
|
|
```js
|
|
|
|
assert([...document.querySelector('html')?.children].some(x => x?.localName === 'head'));
|
|
|
|
```
|
|
|
|
|
|
|
|
The `body` element should be within the `html` element.
|
|
|
|
|
|
|
|
```js
|
|
|
|
assert([...document.querySelector('html')?.children].some(x => x?.localName === 'body'));
|
|
|
|
```
|
|
|
|
|
|
|
|
# --seed--
|
|
|
|
|
|
|
|
## --seed-contents--
|
|
|
|
|
|
|
|
```html
|
|
|
|
--fcc-editable-region--
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
|
|
|
|
</html>
|
|
|
|
--fcc-editable-region--
|
|
|
|
```
|