HTML | DOM blockquote cite Property

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

    filter_none

    edit
    close

    play_arrow

    link
    brightness_4
    code

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

    chevron_right

    
    

    Output:
    Before Clicking the Button:

    After Clicking the Button:

    Example 2: This example sets the blockquote cite property.

    filter_none

    edit
    close

    play_arrow

    link
    brightness_4
    code

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

    chevron_right

    
    

    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
    • Safar


    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.