Get DD Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:DD

Introduction

The DD object represents an HTML <dd> element.

You can access a <dd> element by using getElementById():

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<dl>
  <dt>CSS</dt>
  <dd id="myDD">for style </dd>
</dl>/*  ww  w. ja v a2 s  .  c  o m*/

<button onclick="myFunction()">get the HTML content of the dd element</button>

<p id="demo"></p>

<script>
function myFunction() {
    var x = document.getElementById("myDD").innerHTML;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

Related Tutorials