---
id: bad87fee1348bd9aedf08828
title: 順序付きリストを作成する
challengeType: 0
videoUrl: 'https://scrimba.com/p/pVMPUv/cQ3B8TM'
forumTopicId: 16824
dashedName: create-an-ordered-list
---
# --description--
HTML にはもう一つ、順序付きリスト (ordered lists) または番号付きリストを作成するための特別な要素があります。
順序付きリストは `
` 要素で始まり、その後に任意の数の `- ` 要素が続きます。 最後に、順序付きリストを `
` タグで閉じます。
例:
```html
- Garfield
- Sylvester
```
上の例は `Garfield` と `Sylvester` の番号付きリストを作成します。
# --instructions--
猫が嫌いな物トップ 3 の順序付きリストを作成しましょう。
# --hints--
`Top 3 things cats hate:` の下に順序付きリストを作成してください。
```js
assert(/Top 3 things cats hate:/i.test($('ol').prev().text()));
```
`Things cats love:` の下には順序なしリストが必要です。
```js
assert(/Things cats love:/i.test($('ul').prev().text()));
```
`ul` 要素が 1 つだけ必要です。
```js
assert.equal($('ul').length, 1);
```
`ol` 要素が 1 つだけ必要です。
```js
assert.equal($('ol').length, 1);
```
`ul` 要素の中に `li` 要素が 3 つ必要です。
```js
assert.equal($('ul li').length, 3);
```
`ol` 要素の中に `li` 要素が 3 つ必要です。
```js
assert.equal($('ol li').length, 3);
```
`ul` 要素には終了タグが必要です。
```js
assert(
code.match(/<\/ul>/g) &&
code.match(/<\/ul>/g).length === code.match(//g).length
);
```
`ol` 要素には終了タグが必要です。
```js
assert(
code.match(/<\/ol>/g) &&
code.match(/<\/ol>/g).length === code.match(//g).length
);
```
`li` 要素には終了タグが必要です。
```js
assert(
code.match(/<\/li>/g) &&
code.match(/- /g) &&
code.match(/<\/li>/g).length === code.match(/
- /g).length
);
```
順序なしリストの `li` 要素は空にしないでください。
```js
$('ul li').each((i, val) =>
assert(__helpers.removeWhiteSpace(val.textContent))
);
```
順序付きリストの `li` 要素は空にしないでください。
```js
$('ol li').each((i, val) =>
assert(!!__helpers.removeWhiteSpace(val.textContent))
);
```
# --seed--
## --seed-contents--
```html
CatPhotoApp
Click here to view more cat photos.
Things cats love:
- cat nip
- laser pointers
- lasagna
Top 3 things cats hate:
```
# --solutions--
```html
CatPhotoApp
Click here to view more cat photos.
Things cats love:
- cat nip
- laser pointers
- lasagna
Top 3 things cats hate:
- hate 1
- hate 2
- hate 3
```