DOM ins cite属性用于设置或返回对象的cite属性值元件。 cite属性用于指定文档或消息的URL,该URL表示删除文本的原因。它对任何普通的Web浏览器都没有视觉效果。它只能由屏幕阅读器使用。
用法:
它用于返回cite属性。insObject.cite
它用于设置cite属性。insObject.cite = URL
属性值:
URL:它指定了文档的URL,该URL定义了通过删除其他先前的文本来插入文本的原因。
可能的值为:绝对网址:它用于指出其他网站(例如cite =“ http://www.geeksforgeeks.org”)
相对网址:它用于指出网站内的页面。 (例如cite =” geeks.htm”)
返回值:它返回一个表示文档URL的字符串值。
示例1:此示例说明了如何返回cite属性。
DOM ins cite Propertydel {
color:red;
}
ins {
color:green;
}
h1 {
color:green;
}
body {
text-align:center;
}
GeeksforGeeks
DOM ins cite Property
GeeksforGeeks is a
mathematical
cite="www.GeeeksForGeeks.com">computerscienceportal
Submit
function myGeeks() {
// Return value of cite attribute.
var g = document.getElementById(
"GFG").cite;
document.getElementById(
"sudo").innerHTML = g;
}
输出:
在单击按钮之前:
单击按钮后:
示例2:本示例说明了如何设置引用属性。
DOM ins cite Property
del {
color:red;
}
ins {
color:green;
}
h1 {
color:green;
}
body {
text-align:center;
}
GeeksforGeeks
DOM ins cite Property
GeeksforGeeks is a
mathematical
cite="www.finecomb.com">computerscienceportal
Submit
function myGeeks() {
// set value of cite attribute
var g = document.getElementById(
"GFG").cite = "www.GeeksForGeeks.com"
document.getElementById("sudo").innerHTML =
"The value of the cite attribute was changed to" + g;
}
输出:
在单击按钮之前:
单击按钮后:
支持的浏览器:DOM ins cite属性支持的浏览器如下:
谷歌浏览器
IE浏览器
Firefox
Opera
Safari