Javascript DOM HTML Blockquote cite Property set

Introduction

Change the URL of a quotation:

document.getElementById("myBlockquote").cite = "http://www.example.com/";

Click the button below to change the value of the cite attribute of the quotation.

View in separate window

<!DOCTYPE html>
<html>
<body>
<blockquote id="myBlockquote" cite="https://www.java2s.com">
This is a test./* w w  w .  j  av  a 2s.  co  m*/
</blockquote>
<button onclick="myFunction()">Test</button>

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

<script>
function myFunction() {
  document.getElementById("myBlockquote").cite = "http://www.example.com";
  document.getElementById("demo").innerHTML = "The value of the cite attribute was changed.";
}
</script>

</body>
</html>



PreviousNext

Related