--- id: 60f027c87bc98f050395c139 title: 步驟 3 challengeType: 0 dashedName: step-3 --- # --description-- 接下來,在 `html` 元素中添加 `head` 和 `body` 的開始和結束標籤。 # --hints-- 應該有一個 `head` 開始標籤。 ```js assert(code.match(//i)); ``` 應該有一個 `head` 結束標籤。 ```js assert(code.match(/<\/head\s*>/i)); ``` 應該有一個 `body` 開始標籤。 ```js assert(code.match(//i)); ``` 應該有一個 `body` 結束標籤。 ```js assert(code.match(/<\/body\s*>/i)); ``` `head` 和 `body` 元素應該是同級元素。 ```js assert(document.querySelector('head')?.nextElementSibling.localName === 'body'); ``` `head` 元素應該在 `html` 元素內。 ```js assert([...document.querySelector('html')?.children].some(x => x?.localName === 'head')); ``` `body` 元素應該在 `html` 元素內。 ```js assert([...document.querySelector('html')?.children].some(x => x?.localName === 'body')); ``` # --seed-- ## --seed-contents-- ```html --fcc-editable-region-- --fcc-editable-region-- ```