Return the URL of a quotation:
var x = document.getElementById("myBlockquote").cite;
Click the button below to return the value of the cite attribute of the quotation.
<!DOCTYPE html> <html> <body> <blockquote id="myBlockquote" cite="http://www.java2s.com"> This is a test./*from w w w . j av a2 s .c o m*/ </blockquote> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { var x = document.getElementById("myBlockquote").cite; document.getElementById("demo").innerHTML = x; } </script> </body> </html>
The cite
property sets or gets the cite attribute of a quotation.
The cite attribute tells the source URL of a quotation.