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  ww  . ja v  a2s  .  co  m*/

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

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


Related Tutorials