Get Details Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Details

Introduction

The Details object represents an HTML <details> element.

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

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<details id="myDetails">
Some additional details.../*  ww  w .ja v  a  2  s.  c  om*/
</details>

<button onclick="myFunction()">show additional details</button>

<script>
function myFunction() {
    var x = document.getElementById("myDetails");
    x.open = true;
}
</script>

</body>
</html>

Related Tutorials