Blockquote cite Property - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Blockquote


The cite property sets or gets the value of the cite attribute of a quotation, which controls the source URL of a quotation.

Set the cite property with the following Values

Value Description
URL Sets the source URL of the quotation.

Possible values:

  • An absolute URL - like cite=""
  • A relative URL - like cite="page.htm"

Return Value

A String, representing the URL of the source document

The following code shows how to return the URL of a quotation:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<blockquote id="myBlockquote" cite="">
quote//from   w  w  w.  j  a v a  2  s  .  c  o  m

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

function myFunction() {
    var v = document.getElementById("myBlockquote").cite;
    document.getElementById("demo").innerHTML = v;


Related Tutorials