Command Palette

Search for a command to run...

Hectal
Back to the lesson: Topic 1.5 — Lists
HTML · Example 2 of 2

start, reversed, type and value

value resets the count, and the next item continues from it. li.value reads only an explicit value, so the last item reports 0.

HTML has three lists: <ul> when order doesn't matter, <ol> when it does (with start, reversed and type to control the numbers), and <dl> for terms and their descriptions; lists can nest inside list items.

Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.

Ready for more? This phase has 5 hands-on exercises with automatic checks.

Practice questions

Write the code in the editor, run it, then open the model answer to compare.

01

Write a top-5 list of your favourite films, numbered 5 down to 1.

02

Write a packing list with three bullets, where the item Clothes has its own nested bullet list of Shirts and Socks.

03

Write a description list for a phone: Screen is 6.1 inches, Battery is 4000 mAh.

Explain it without notes

01

When do you use <ul>, <ol> and <dl>?

02

How do you nest a list correctly, and what goes wrong if you don't?

03

What do start, reversed, type and value do?

04

Why should a navigation menu be a list?

start, reversed, type and value

Preview

Press Run to see the page.

Console

Nothing logged yet.

Expected console output

start: 5 reversed: true type: A
Last item's value: 0