Javascript examples for DOM HTML Element:DD
You can create a <dd> element by using the document.createElement() method:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">create a DD element with some text.</button><br><br> <dl id="myDL"> <dt>CSS</dt> </dl>/*from w ww . ja v a2s . co m*/ <script> function myFunction() { var x = document.createElement("DD"); var t = document.createTextNode("for style"); x.appendChild(t); var y = document.getElementById("myDL"); y.appendChild(x); } </script> </body> </html>