/

HTML / CSS / JavaScript Tutorial

HTML Standard attribute: reversed

[this page | pdf | back links]

The HTML reversed attribute indicates whether the list order of an <ol> element should be in descending order (e.g. 3, 2, 1) rather than ascending order (1, 2, 3).

 

Valid attribute values (when used with <ol> elements) include:

 

Value

Description

reversed

List order is descending

 

EXAMPLE:


HTML USED IN THIS EXAMPLE:
<!DOCTYPE html>
<html> <!-- Copyright (c) Nematrian Limited 2018 -->
<head></head>
<body>
Created using HTML:<br>
<ol>
<li>A</li>
<li>B</li>
</ol>

<br><br>Created using JavaScript (does not currently work with Internet Explorer / Edge:<br>
<ol id="x1">
<li>A</li>
<li>B</li>
</ol>

<script>
var att = document.createAttribute("reversed");
att.value = "reversed";
document.getElementById("x1").reversed = true;
</script>

</body>
</html>


NAVIGATION LINKS
Contents | Prev | Next | HTML Attributes


Desktop view | Switch to Mobile