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:
A String, representing the URL of the source document
The following code shows how to return the URL of a quotation:
<!DOCTYPE html> <html> <body> <blockquote id="myBlockquote" cite="http://www.java2s.com"> quote//from w w w. j a v a 2 s . c o m </blockquote> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { var v = document.getElementById("myBlockquote").cite; document.getElementById("demo").innerHTML = v; } </script> </body> </html>