Đối tượng HTML DOM Ol
Đối tượng Ol
Đối tượng Ol đại diện cho một phần tử HTML <ol>.
Truy cập một đối tượng Ol
Bạn có thể truy cập một phần tử <ol> bằng cách sử dụng getElementById ():
Thí dụ
var x = document.getElementById("myOl");
Tạo một đối tượng Ol
Bạn có thể tạo một phần tử <ol> bằng cách sử dụng phương thức document.createElement ():
Thí dụ
var x = document.createElement("OL");
Thuộc tính đối tượng Ol
Property | Description |
---|---|
compact | Not supported in HTML5. Use style.lineHeight instead. Sets or returns whether the list should render smaller than normal, or not |
reversed | Sets or returns whether the list order should be descending or not |
start | Sets or returns the value of the start attribute of an ordered list |
type | Sets or returns the value of the type attribute of an ordered list |
Thuộc tính và sự kiện tiêu chuẩn
Đối tượng Ol cũng hỗ trợ các thuộc tính và sự kiện tiêu chuẩn .
Các trang liên quan
Tham chiếu HTML: Thẻ <ol> HTML