HTML5 Details/Summary Open at Top Close From Bottom - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Details

Description

HTML5 Details/Summary Open at Top Close From Bottom

Demo Code

ResultView the demo in separate window

<html>
   <head></head>
   <body> 
      <script>
function closeDetails() {/*from  w ww  . j  a v  a2s  .  com*/
    document.getElementById("details").removeAttribute("open");
    window.location = "#details";
}

      </script> 
      <details id="details"> 
         <summary>Show Details</summary> 
         <p>yadda yadda</p> 
         <button onclick="closeDetails()">Close Details</button> 
      </details>  
   </body>
</html>

Related Tutorials