Get Article Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Article


The Article object represents an HTML <article> element.

You can access an <article> element by using getElementById():

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<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>

function myFunction() {
    var x = document.getElementById("myArticle"); = "blue"; = "1px red double";


Related Tutorials