DOM Ol类型的Property用于在有序列表中设置或返回type属性。此属性定义列表项中要使用的标记的类型。
用法:
它用于返回type属性。olObject.type
它用于设置type属性。olObject.type = "1|a|A|i|I"
属性值:
1:这是默认值。它以十进制数(1、2、3、4。)定义列表项。
a:它以字母顺序定义的小写字母定义列表项。(a,b,c,d…)
A:它以字母大写字母定义列表项。(A,B,C,D ..)
i:它以小写罗马数字顺序定义列表项。(i,ii,iii,iv,v,vi…)
I:它以大写罗马数字顺序定义列表项。(I,II,III,IV,V,VI ..)
返回值:它返回一个字符串值,该字符串值表示在有序列表中使用的标记的种类。
示例1:演示如何设置类型Property的HTML程序。
dom ol type PropertyGeeksforGeeks
DOM ol type Property
List of all computer Subjects are
- Data Structures
- Operating System
- Python programming
- DBMS
- Computer Network
Submit
function myGeeks() {
var x = document.getElementById("GFG").type = "a";
}
输出:
在单击按钮之前:
单击按钮后:
示例2:说明如何返回类型Property的HTML程序。
Dom ol type PropertyGeeksforGeeks
DOM ol type Property
List of all computer Subjects are
- Data Structures
- Operating System
- python programming
- DBMS
- Computer Network
Submit
function myGeeks() {
var x = document.getElementById("GFG").type;
document.getElementById("sudo").innerHTML =
"The type of Ordered list:" + x;
}
输出:
在单击按钮之前:
单击按钮后:
支持的浏览器:下面列出了DOM ol类型“属性”支持的浏览器:
谷歌浏览器
IE浏览器
Firefox
Opera
Safari