--- id: bad87fee1348bd9aedf08828 challengeType: 0 videoUrl: 'https://scrimba.com/p/pVMPUv/cQ3B8TM' forumTopicId: 16824 localeTitle: 创建一个有序列表 --- ## Description
HTML 有一个特定的元素用于创建有序列表ordered lists(缩写 ol)。 有序列表以<ol>开始,中间包含一个或多个<li>元素,最后以</ol>结尾。 例如: ```html
  1. 加菲猫
  2. 哆啦A梦
``` 将会创建一个包含加菲猫和哆啦A梦的有序列表。
## Instructions
创建一个有序列表,内容是猫咪最讨厌的三件东西,内容可以任意指定。
## Tests
```yml tests: - text: '页面应该有一个无序列表,内容是猫咪最喜欢的三件东西。' testString: assert((/Top 3 things cats hate:/i).test($("ol").prev().text())); - text: '页面应该有一个有序列表,内容是猫咪最讨厌的三件东西。' testString: assert((/Things cats love:/i).test($("ul").prev().text())); - text: '页面应该只有一个ul元素。' testString: assert.equal($("ul").length, 1); - text: '页面应该只有一个ol元素。' testString: assert.equal($("ol").length, 1); - text: 'ul无序列表应该包含3个li条目。' testString: assert.equal($("ul li").length, 3); - text: 'ol有序列表应该包含3个li元素。' testString: assert.equal($("ol li").length, 3); - text: '确保ul无序列表有结束标记。' testString: assert(code.match(/<\/ul>/g) && code.match(/<\/ul>/g).length === code.match(/
## Challenge Seed
```html

CatPhotoApp

点击查看更多猫咪图片

一只仰卧着的萌猫

猫咪最喜欢的三件东西:

  • 猫薄荷
  • 激光笔
  • 千层饼

猫咪最讨厌的三件东西:

```
## Solution