DOM HR noshade属性用于设置或返回实线水平线,而不是阴影线。它返回一个布尔值。
用法:
它返回HR noshade属性。hrobject.noshade
设置HR noshade属性。hrobject.noshade="true/false"
属性值:
true:用于指定水平实线而不是阴影线。
false:用于指定阴影线。
范例1:本示例返回一个noshade属性。
HTML DOM HR noshade propertyGeeksForGeeks
DOM HR noshade Property
There is a horizontal rule
below this paragraph.
width="240px" color="red" noshade>
This is a horizontal rule
above this paragraph.
Try it
function myGeeks() {
// Accessing 'hr' tag.
var x = document.getElementById("GFG").noShade;
document.getElementById("sudo").innerHTML = x;
}
输出:
在单击按钮之前:
单击按钮后:
范例2:本示例设置HR noshade属性。
HTML DOM HR noshade propertyGeeksForGeeks
DOM HR noshade Property
There is a horizontal rule
below this paragraph.
width="240px" color="red" noshade>
This is a horizontal rule
above this paragraph.
Try it
function myGeeks() {
// Accessing 'hr' tag.
var x = document.getElementById("GFG").noShade
= "false";
document.getElementById("sudo").innerHTML = x;
}
输出:
在单击按钮之前:
单击按钮后:
支持的浏览器:下面列出了DOM HR noshade属性支持的浏览器:
谷歌浏览器
IE浏览器
Firefox
Safari
Opera