title: How to get the parentNode
body: <p>Trying to create a simple document that gets the parentNode then applies a background color. My <code>getElementByTagName</code> is "p" so the parentNode would be the <code>&lt;body&gt;</code>. The background color should then be applied to the entire document, right?  I'm getting an "object expected" error.</p>
  
  <pre><code>&lt;!--purpose is to use parent node and change the background color--&gt;
  &lt;html&gt;
  &lt;body&gt;
  &lt;head&gt;
  &lt;script type="text/javascript" language="javascript"&gt;
  function changeIt() {
    var node;
    node = document.getElementsByTagName("p").parentNode;
    node.style.background-color = '#0033dd';
  }
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;div id="teams"&gt;
    &lt;h1&gt;NFL Teams&lt;/h1&gt;
  
    &lt;h2&gt;NFC North&lt;/h2&gt;
    &lt;p&gt;Chicago Bears&lt;/p&gt;
    &lt;p&gt;Green Bay Packers&lt;/p&gt;
    &lt;p&gt;Minnesota Vikings&lt;/p&gt;
    &lt;p&gt;Detroit Lions&lt;/p&gt;
  
    &lt;h2&gt;NFC South&lt;/h2&gt;
    &lt;p&gt;New Orleans Saints&lt;/p&gt;
    &lt;p&gt;Atlanta Falcons&lt;/p&gt;
    &lt;p&gt;Carolina Panthers&lt;/p&gt;
    &lt;p&gt;Tampa Bay Buccannears&lt;/p&gt;
  
    &lt;h2&gt;NFC East&lt;/h2&gt;
    &lt;p&gt;Dallas Cowboys&lt;/p&gt;
    &lt;p&gt;Washington Redskins&lt;/p&gt;
    &lt;p&gt;Philadelphia Eagles&lt;/p&gt;
    &lt;p&gt;NY Giants&lt;/p&gt;
  
    &lt;h2&gt;NFC West&lt;/h2&gt;
    &lt;p&gt;San Francisco 49ers&lt;/p&gt;
    &lt;p&gt;Arizona Cardinals&lt;/p&gt;
    &lt;p&gt;Seattle Seahawks&lt;/p&gt;
    &lt;p&gt;St.Louis Rams&lt;/p&gt;
  &lt;/div&gt;
  
  &lt;input type="button" value="change background color" onClick="changeIt()"&gt;   
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>