title: Unable to get property 'addEventListener'
body: <p>I have been working on a small aspect of my application today and wanted to get a sliding bar on my application. I asked a question this morning where there was some good answers. I have recently wanted to try and answer that i ws given using <strong>Script</strong>, <strong>CSS</strong> and <strong>HTML</strong>. </p>
  
  <p>I am getting to problem to get the <strong>Script</strong> working as it keeps coming up with an error saying:</p>
  
  <pre><code> 0x800a138f - JavaScript runtime error: Unable to get property 'addEventListener' of undefined or null reference
  </code></pre>
  
  <p>This is the <strong>Script</strong>:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
      var desktops = document.querySelectorAll('.desktop');
  
      function hide(element) {
          element.style.setProperty('left', '-100%', element.style.getPropertyPriority('left'));
      }
  
      function hideAll() {
          for (var i = 0; i &lt; desktops.length; i++) {
              hide(desktops[i]);
          }
      }
  
      function show(element) {
          element.style.setProperty('left', '0', element.style.getPropertyPriority('left'));
      }
  
      document.getElementById('link-one').addEventListener('click', function () {
          hideAll();
          show(document.getElementById('one'));
      }, false);
  
  
      show(document.getElementById('one'));
  &lt;/script&gt;
  </code></pre>
  
  <p>Here is the <strong>HTML</strong>:</p>
  
  <pre><code>&lt;ul&gt;
  &lt;li id="link-one"&gt;
    &lt;div&gt;1&lt;/div&gt;
    &lt;div&gt;One&lt;/div&gt;
  &lt;/li&gt;
  &lt;/ul&gt;
  
  &lt;div id="one" class="desktop"&gt;
    &lt;h1&gt;Sidebar Example&lt;/h1&gt;
    &lt;p&gt;This is 1&lt;/p&gt;
    &lt;p&gt;Something here.&lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>From what I can work out its not being able to find the ID?</p>