Get Details Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Details


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>

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

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

function myFunction() {
    var x = document.getElementById("myDetails"); = true;


Related Tutorials