Get DT Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:DT

Introduction

The DT object represents an HTML <dt> element.

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

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<dl>
  <dt id="myDT">CSS</dt>
  <dd>style</dd>
</dl>//from   www .  j  a  va 2s  .com

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

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

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

</body>
</html>

Related Tutorials