title: addEventListener to submenu links only, without jQuery
body: <p>I would like to add an event listener to the <code>#nav ul a</code> links only. <strong>Ordinerly i would use jQuery for this, but I can't with this project.</strong></p>
  
  <p>Basically I need to change the style of the sub menu <code>&lt;UL&gt;</code> when it’s child link <code>&lt;A&gt;</code> has keyboard (tab) focus.</p>
  
  <p>So, the HTML:</p>
  
  <pre><code>&lt;ul id="nav"&gt;
      &lt;li&gt;&lt;a href="#"&gt;Top 1&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#"&gt;Top 2&lt;/a&gt;
        &lt;ul&gt;
          &lt;li&gt;&lt;a href="#"&gt;link&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#"&gt;link&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#"&gt;link&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;              
      &lt;/li&gt;
      &lt;li&gt;&lt;a href="#"&gt;Top 3&lt;/a&gt;
        &lt;ul&gt;
          &lt;li&gt;&lt;a href="#"&gt;link&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#"&gt;link&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#"&gt;link&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;              
      &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>I've got this far with the Javascript but it's also selecting the top <code>&lt;ul id="nav"&gt;</code> element:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
          function linkOn(e) {
              var target = e.target.parentNode.parentNode;
              target.style.color = "green";
          }
          function linkOff(e) {
              var target = e.target.parentNode.parentNode;
              target.style.color = "";
          }           
  
          function addListeners() {
  
              var arrayTop = document.getElementById("nav").getElementsByTagName("a");
              for (var i = 0; i &lt; arrayTop.length; i++)
              {
                  arrayTop[i].addEventListener("focus",linkOn,false);
                  arrayTop[i].addEventListener("blur",linkOff,false);
              }               
          }
  
          window.addEventListener('load', addListeners, false);
      &lt;/script&gt;
  </code></pre>