Create a Quote Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Quote


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

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<button onclick="myFunction()">create a QUOTE element with a link to as the source of the quotation</button>

function myFunction() {//  w  w  w . j  a v a  2  s.c o m
    var x = document.createElement("QUOTE");
    var t = document.createTextNode("test test test.");
    x.setAttribute("cite", "");


Related Tutorials