HTMLOListElement: reversed property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.

Thuộc tính reversed của giao diện HTMLOListElement cho biết thứ tự của danh sách.

Nó phản ánh thuộc tính reversed của phần tử <ol>.

Giá trị

Giá trị boolean. Nếu true, nó cho biết danh sách là danh sách giảm dần (..., 3, 2, 1).

Ví dụ

HTML

html
<ol id="order-list">
  <li>Fee</li>
  <li>Fi</li>
  <li>Fo</li>
  <li>Fum</li>
</ol>

JavaScript

js
const olElement = document.querySelector("#order-list");
console.log(olElement.reversed); // Output: "false"
olElement.reversed = "true";
console.log(olElement.reversed); // Output: "true"

Kết quả

Thông số kỹ thuật

Thông số kỹ thuật
HTML
# dom-ol-reversed

Tương thích trình duyệt