Quote cite Property - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Quote

Description

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

Set the cite property with the following Values

Value Description
URL Sets the source URL of the quotation.

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>
<html>
<body>

<p><q id="myQuote" cite="http://java2s.com">test.</q>
</p>//from   www .  j  a  va2s .com

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

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

<script>
function myFunction() {
    var v = document.getElementById("myQuote").cite;
    document.getElementById("demo").innerHTML = v;
}
</script>

</body>
</html>

Related Tutorials