Create a Blockquote Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Blockquote


You can create a <blockquote> element by using the document.createElement() method:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<button onclick="myFunction()">create a BLOCKQUOTE element</button>

function myFunction() {/*from  w w w .j a  va2  s  . c om*/
    var x = document.createElement("BLOCKQUOTE");
    var t = document.createTextNode("text in quote");
    x.setAttribute("cite", "");


Related Tutorials