Get DFN Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:DFN

Introduction

The DFN object represents an HTML <dfn> element.

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

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<dfn id="myDFN">Definition term</dfn>

<button onclick="myFunction()">set the color of the definition term</button>

<script>
function myFunction() {/*from w w  w. j  a v a2  s  .co  m*/
    var x = document.getElementById("myDFN");
    x.style.color = "blue";
}
</script>

</body>
</html>

Related Tutorials