HTML | DOM Quote cite Property

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. =”http://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:



filter_none

edit
close

play_arrow

link
brightness_4
code

<!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>                             

chevron_right


Output:

  • Before clicking on the Button:
  • After clicking on the Button:

Example 2:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!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>                             

chevron_right


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

full-stack-img




My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.