HTML | DOM Quote cite Property
Last Updated :
30 Nov, 2019
The HTML DOM Quote cite Property is used to set or return the cite attribute of a quotation. The cite attribute specifies the source URL of a quotation.
Syntax:
- It returns the cite property.
quoteObject.cite
- It is used to set the cite property
quoteObject.cite = URL
Property Values: It contains single value URL which is used to specify the URL of the quotation. The possible value of the URL are:
- Absolute URL: It is used to point out other websites (like cite. =”https://www.geeksforgeeks.org”)
- Relative URL: It is used to point out the page within the website. (like =”page.html”)
Return Value: It returns string value which representing the URL of the source document.
Example 1:
<!DOCTYPE html>
< html >
< head >
< title >
HTML DOM Quote cite Property
</ title >
</ head >
< body >
< h1 >GeeksforGeeks</ h1 >
< h2 >DOM Quote cite Property</ h2 >
< q id = "GFG" cite = "geeksforgeeks.org" >
GeeksforGeeks
</ q >
< br >< br >
< button onclick = "Geeks()" >
Submit
</ button >
< p id = "sudo" ></ p >
< script >
function Geeks() {
var ct = document.getElementById("GFG").cite;
document.getElementById("sudo").innerHTML = ct;
}
</ script >
</ body >
</ html >
|
Output:
- Before clicking on the Button:
- After clicking on the Button:
Example 2:
<!DOCTYPE html>
< html >
< head >
< title >
HTML DOM Quote cite Property
</ title >
</ head >
< body >
< h1 >GeeksforGeeks</ h1 >
< h2 >DOM Quote cite Property</ h2 >
< q id = "GFG" cite = "Finecomb.com" >
GeeksforGeeks
</ q >
< br >< br >
< button onclick = "Geeks()" >
Submit
</ button >
< p id = "sudo" ></ p >
< script >
function Geeks() {
var ct = document.getElementById("GFG").cite
= "www.geeksforgeeks.org";
document.getElementById("sudo").innerHTML
= "The cite was changed to " + ct;
}
</ script >
</ body >
</ html >
|
Output:
- Before clicking on the Button:
- After clicking on the Button:
Supported Browsers: The browsers supported by HTML DOM Quote cite Property are listed below:
- Google Chrome
- Internet Explorer
- Firefox
- Apple Safari
- Opera
Share your thoughts in the comments
Please Login to comment...