---
id: bad87fee1348bd9aedf08828
title: Creare una lista ordinata
challengeType: 0
videoUrl: 'https://scrimba.com/p/pVMPUv/cQ3B8TM'
forumTopicId: 16824
dashedName: create-an-ordered-list
---
# --description--
HTML ha un altro elemento speciale per creare liste ordinate o elenchi numerati.
Le liste ordinate iniziano con un elemento di apertura `
` , seguito da un numero qualsiasi di elementi `- `. Infine, le liste ordinate vengono chiuse con il tag `
`.
Ad esempio:
```html
- Garfield
- Sylvester
```
creerebbe una lista numerata di `Garfield` e `Sylvester`.
# --instructions--
Crea una lista ordinata delle tre cose che i gatti odiano di piĆ¹.
# --hints--
Dovresti avere una lista ordinata per `Top 3 things cats hate:`
```js
assert(/Top 3 things cats hate:/i.test($('ol').prev().text()));
```
Dovresti avere una lista non ordinata per `Things cats love:`
```js
assert(/Things cats love:/i.test($('ul').prev().text()));
```
Dovresti avere un solo elemento `ul`.
```js
assert.equal($('ul').length, 1);
```
Dovresti avere un solo elemento `ol`.
```js
assert.equal($('ol').length, 1);
```
Dovresti avere tre elementi `li` all'interno del tuo elemento `ul`.
```js
assert.equal($('ul li').length, 3);
```
Dovresti avere tre elementi `li` all'interno del tuo elemento `ol`.
```js
assert.equal($('ol li').length, 3);
```
Il tuo elemento `ul` dovrebbe avere un tag di chiusura.
```js
assert(
code.match(/<\/ul>/g) &&
code.match(/<\/ul>/g).length === code.match(//g).length
);
```
Il tuo elemento `ol` dovrebbe avere un tag di chiusura.
```js
assert(
code.match(/<\/ol>/g) &&
code.match(/<\/ol>/g).length === code.match(//g).length
);
```
Il tuo elemento `li` dovrebbe avere un tag di chiusura.
```js
assert(
code.match(/<\/li>/g) &&
code.match(/- /g) &&
code.match(/<\/li>/g).length === code.match(/
- /g).length
);
```
Gli elementi `li` nella tua lista non ordinata non dovrebbero essere vuoti.
```js
$('ul li').each((i, val) =>
assert(__helpers.removeWhiteSpace(val.textContent))
);
```
Gli elementi `li` nella tua lista ordinata non dovrebbero essere vuoti.
```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
```