Create a DD Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:DD


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

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<button onclick="myFunction()">create a DD element with some text.</button><br><br>

<dl id="myDL">
</dl>/*from w w  w . j  a  va2  s .com*/

function myFunction() {
    var x = document.createElement("DD");
    var t = document.createTextNode("for style");

    var y = document.getElementById("myDL");


Related Tutorials