Open In App

HTML | DOM blockquote cite Property

Last Updated : 17 Oct, 2019
Improve
Improve
Like Article
Like
Save
Share
Report

The blockquote cite Property in HTML DOM is used to set or return the value of the cite attribute of a quotation. It is used to specify the URL of the Quotation. It does not contains visual effect on any ordinary Web Browser. It can only be used by screen readers.

Syntax:

  • It returns the blockquote cite property.
    blockquoteObject.cite
  • It is used to set the blockquote cite property.
    blockquoteObject.cite = URL

Property Values: It contains single value URL which specifies the URL of the quotation. The URL contains two possible values which are listed below:

  • Absolute URL: It is used to refer to the other website. For example cite = “https://www.geeksforgeeks.org”
  • Relative URL: It is used to refer to the web page within the website. For example cite = “geeks.htm
  • Example 1: This example returns the blockquote cite property.




    <!DOCTYPE html> 
    <html
      
    <head
        <title>
            HTML DOM blockquote cite Property
        </title
    </head
      
    <body style="text-align:center;"
          
        <h1 style="color:green;">GeeksforGeeks</h1
        <h2>DOM blockquote cite Property</h2
          
        <blockquote ID="GFG" cite="www.geeksforgeeks.org"
            GeeksforGeeks: A computer science portal for geeks 
        </blockquote
          
        <button onclick="myGeeks()">Submit</button
      
        <p id="sudo" style="color:green;font-size:24px;"></p
          
        <!-- Script to return blockquote cite Property -->
        <script
            function myGeeks() { 
                var w = document.getElementById("GFG").cite; 
                document.getElementById("sudo").innerHTML = w; 
            
        </script
    </body
      
    </html>                    

    
    

    Output:
    Before Clicking the Button:

    After Clicking the Button:

    Example 2: This example sets the blockquote cite property.




    <!DOCTYPE html> 
    <html
      
    <head
        <title>
            HTML DOM blockquote cite Property
        </title
    </head
      
    <body style="text-align:center;"
          
        <h1 style="color:green;">GeeksforGeeks</h1
        <h2>DOM blockquote cite Property</h2
          
        <blockquote ID="GFG" cite="www.geeksforgeeks.org"
            GeeksforGeeks: A computer science
            portal for geeks 
        </blockquote
          
        <button onclick="myGeeks()">Submit</button
      
        <p id="sudo" style="color:green;font-size:24px;"></p
          
        <!-- Script to set DOM blockquote cite Property -->
        <script
            function myGeeks() { 
                var w = document.getElementById("GFG").cite
                    = "www.gfg.org"; 
                          
                document.getElementById("sudo").innerHTML
                    = "The cite attribte was changed to " + w; 
            
        </script
    </body
      
    </html>                    

    
    

    Output:
    Before Clicking the Button:

    After Clicking the Button:

    Supported Browsers: The browser supported by DOM blockquote cite property are listed below:

    • Google Chrome
    • Internet Explorer
    • Firefox
    • Opera
    • Safari


    Like Article
    Suggest improvement
    Share your thoughts in the comments

Similar Reads