Javascript examples for DOM HTML Element:Section
The Section object represents an HTML <section> element.
You can access a <section> element by using getElementById():
<!DOCTYPE html> <html> <body> <section id="mySection"> <h1>Section Heading</h1> <p>Some text in section..</p> </section>/*from w w w. j av a 2 s.c om*/ <button onclick="myFunction()">set the text color of the section content</button> <script> function myFunction() { var x = document.getElementById("mySection"); x.style.color = "blue"; } </script> </body> </html>