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>/* www .  jav  a  2s  . c  om*/

<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