Javascript examples for DOM HTML Element:Summary
The Summary object represents an HTML <summary> element.
You can access a <summary> element by using getElementById():
<!DOCTYPE html> <html> <body> <details> <summary id="mySummary">Copyright 2020-2030.</summary> <p> - by java2s.com. All Rights Reserved.</p> </details>/* w ww . j a va2 s . co m*/ <button onclick="myFunction()">get the HTML content of the summary element</button> <p id="demo"></p> <script> function myFunction() { var x = document.getElementById("mySummary").innerHTML; document.getElementById("demo").innerHTML = x; } </script> </body> </html>