Javascript examples for DOM HTML Element:Article
The Article object represents an HTML <article> element.
You can access an <article> element by using getElementById():
<!DOCTYPE html> <html> <body> <article id="myArticle"> <h1>Article Heading</h1> <p>Some article text..</p> </article>/* w w w .j a v a 2s.c o m*/ <button onclick="myFunction()">set the text color of the article content</button> <script> function myFunction() { var x = document.getElementById("myArticle"); x.style.color = "blue"; x.style.border = "1px red double"; } </script> </body> </html>