HTML reversed Attribute

Beginner
⏱️ 4 min read
📚 Updated: Jun 2026
🎯 3 Examples
Lists & Layout

Introduction

The reversed attribute is a boolean attribute on <ol> (ordered lists) that makes list markers count down instead of up. With three items and no start value, markers show 3, 2, 1 while the DOM order of <li> elements stays the same. Use it for rankings (3rd place first), countdown steps, or any descending sequence. Set element.reversed = true in JavaScript to toggle it dynamically. Not the same as the obsolete rev link attribute — see the rev guide for that distinction.

What You’ll Learn

01

Countdown

Reverse markers.

02

ol only

Scope.

03

Boolean

Values.

04

+ start

Custom base.

05

.reversed

JS toggle.

06

vs rev

Not links.

Purpose of reversed Attribute

By default, an ordered list numbers items starting at 1 and increasing: 1, 2, 3, … The reversed attribute flips the marker direction so the first visible item gets the highest number and each following item counts down.

This is useful when the visual reading order should stay top-to-bottom but the numbers should reflect descending rank or sequence — for example, a podium list (gold, silver, bronze) labeled 3, 2, 1, or a “countdown to launch” checklist.

💡
Markers only — not DOM order

reversed changes how the browser numbers list items. It does not reorder <li> elements in the document. Put items in the order you want readers to see them; let reversed handle the numbers.

📝 Syntax

Add the boolean reversed attribute to an <ol>:

reversed.html
<ol reversed>
  <li>Third place</li>
  <li>Second place</li>
  <li>First place</li>
</ol>
<!-- Renders as 3, 2, 1 -->

Syntax Rules

  • Valid only on <ol> — not on <ul> or other elements.
  • Boolean attribute: presence means true; omit for default ascending order.
  • Works with start to set the first marker value before counting down.
  • Works with type (1, a, A, i, I) for marker style.
  • JavaScript: olElement.reversed = true or false.
  • Does not reverse nested lists unless each nested <ol> has its own reversed.
  • Unrelated to obsolete rev on links.

💎 Values

reversed is a boolean attribute — it has no meaningful string values:

  • reversed or reversed="" or reversed="reversed" — list markers count down.
  • (attribute absent) — default ascending numbering from start (default 1).
reversed-start.html
<!-- Three items, no start: 3, 2, 1 -->
<ol reversed>...</ol>

<!-- start="10" reversed: 10, 9, 8 -->
<ol start="10" reversed>...</ol>

<!-- type="A" reversed: C, B, A -->
<ol type="A" reversed>...</ol>

⚡ Quick Reference

Markup3 items, markersNotes
<ol>1, 2, 3Default ascending
<ol reversed>3, 2, 1Countdown from item count
<ol start="5" reversed>5, 4, 3Custom starting number
ol.reversed = trueToggle via JSBoolean DOM property
<ul reversed>No effectInvalid — ol only
rev="related"N/ADifferent attribute (links)

Applicable Elements

ElementSupports reversed?Effect
<ol>YesMarkers count down
<ul>NoAttribute ignored
<li>NoSet on parent ol
<a> / <link>NoUse rev (obsolete) — not reversed

Normal ol vs reversed

AspectDefault <ol><ol reversed>
First marker (3 items)13
DirectionAscendingDescending
DOM order of liUnchangedUnchanged
With start="10"10, 11, 1210, 9, 8
CSS alternativelist-style defaultsNo pure-CSS equivalent for native ol counters

Examples Gallery

Basic reversed lists, JavaScript toggling with element.reversed, and combining start with countdown numbering.

👀 Live Preview

Podium-style list — items read top to bottom, numbers count down:

  1. Bronze — Team C
  2. Silver — Team B
  3. Gold — Team A

Markers show 3, 2, 1 because reversed is on the ol.

Example — Basic reversed list

Three steps displayed in reading order with descending numbers:

reversed-basic.html
<ol reversed>
  <li>Third item</li>
  <li>Second item</li>
  <li>First item</li>
</ol>
Try It Yourself

How It Works

The browser counts items, then assigns markers from that total downward. Three items without start produce 3, 2, 1.

Dynamic Values with JavaScript

Toggle countdown numbering with the reversed DOM property:

dynamic-reversed.html
<ol id="dynamicList">
  <li>Step three</li>
  <li>Step two</li>
  <li>Step one</li>
</ol>
<button id="toggleBtn">Toggle reversed</button>

<script>
  const list = document.getElementById("dynamicList");
  document.getElementById("toggleBtn").addEventListener("click", () => {
    list.reversed = !list.reversed;
  });
</script>
Try It Yourself

How It Works

HTMLOListElement.reversed is a boolean. Assign true to enable countdown markers; false restores ascending order.

Example — start with reversed

Begin the countdown from a custom number:

reversed-start-countdown.html
<h2>Launch countdown</h2>
<ol start="10" reversed>
  <li>T-minus 10</li>
  <li>T-minus 9</li>
  <li>T-minus 8</li>
</ol>
<!-- Markers: 10, 9, 8 -->
Try It Yourself

How It Works

start sets the value of the first marker; reversed makes each subsequent marker decrease by one.

♿ Accessibility

  • Screen readers — Generally announce list position; reversed markers may still be read in DOM order. Ensure list item text is self-explanatory.
  • Meaningful labels — Do not rely on numbers alone. Write clear <li> content (e.g. “Gold — Team A” not just “Team A”).
  • Logical reading order — Keep li elements in the order users should read them; use reversed for number styling, not as a substitute for reordering confusing content.
  • Nested lists — Apply reversed per ol when sub-lists need their own countdown.
  • Not rev — Assistive tech does not treat reversed as link metadata; it only affects list presentation.

🧠 How reversed Works

1

Write ol + li

DOM order set.

Markup
2

Add reversed

Boolean on ol.

Attribute
3

Count items

Or use start.

Counter
=

Countdown markers

3, 2, 1 …

Browser Support

The reversed attribute is part of HTML5 and works in all modern browsers. No polyfill is needed for standard ordered lists.

HTML5 · Widely supported

reversed on ol

Native countdown list numbering — no JavaScript required.

99% Browser support
Chrome 18+
Supported
Firefox 18+
Supported
Safari 6+
Supported
reversed on ol Excellent

Bottom line: Safe to use for descending ordered lists in production.

💡 Best Practices

✅ Do

  • Use reversed when descending numbers match your content (rankings, countdowns)
  • Pair with start when the first number should not equal the item count
  • Keep li text descriptive so meaning does not depend on marker direction
  • Toggle with ol.reversed when users need ascending/descending views
  • Read the <ol> tag guide for full list semantics

❌ Don’t

  • Put reversed on <ul> — it has no effect
  • Expect reversed to reorder DOM nodes — only markers change
  • Confuse reversed with obsolete rev on links
  • Reverse lists solely for visual trickery when ascending order is clearer
  • Rely on reversed numbering for security or business logic — it is presentation only

Conclusion

The reversed attribute is a simple way to show descending list markers on <ol> without rearranging your HTML.

Combine it with start and type for flexible countdown and ranking lists, and toggle it in JavaScript with element.reversed when you need dynamic behavior.

Key Takeaways

Knowledge Unlocked

Five truths every developer should know about reversed

Bookmark these when building ordered lists.

5
Core concepts
📉 02

Countdown

3, 2, 1.

Effect
03

Boolean

On or off.

Value
📝 04

+ start

Custom base.

Combo
🚫 05

Not rev

Different attr.

Gotcha

❓ Frequently Asked Questions

It makes ordered list markers count down instead of up. Three items without start display as 3, 2, 1.
No. <li> elements stay in the same DOM order. Only the displayed numbers (markers) reverse.
No. reversed is a boolean on <ol> for list numbering. rev was an obsolete link attribute — completely unrelated.
document.getElementById("myList").reversed = true; — the property is a boolean on HTMLOListElement.
Yes. start sets the first marker; reversed counts down from there. Example: start="10" reversed with three items shows 10, 9, 8.
Yes. All modern browsers support reversed on <ol> as part of HTML5.

Count down with native HTML

Add reversed to any ol for descending list numbers — no JavaScript or CSS counters required.

Try it yourself →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful