title: Uncaught TypeError: Cannot read property 'children' of null
body: <p>I am very new to Javascript.
  I am having an error:</p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot read property 'children' of null fiddle.jshell.net:1163
    (anonymous function)</p>
  </blockquote>
  
  <p>How to fix the error?</p>
  
  <p>Providing my fiddle below: </p>
  
  <p><a href="http://jsfiddle.net/N3GTy/29/embedded/result/" rel="nofollow noreferrer">http://jsfiddle.net/N3GTy/29/embedded/result/</a></p>
  
  <pre><code>var slider = new Swipe(document.getElementById('slider'), {
      callback: function(e, pos) {
  
          var i = bullets.length;
          while (i--) {
              bullets[i].className = ' ';
          }
          bullets[pos].className = 'on';
  
      }
  }),
  
  bullets = document.getElementById('position').getElementsByTagName('em'),
  
  // tabs
  tabs = new Swipe(document.getElementById('tabs'), {
      callback: function(event, index, elem) {
          setTab(selectors[index]);
      }
  }),
  
  selectors = document.getElementById('tabSelector').children;
  Uncaught TypeError: Cannot read property 'children' of null
  
  for (var i = 0; i &lt; selectors.length; i++) {
      var elem = selectors[i];
      elem.setAttribute('data-tab', i);
      elem.onclick = function(e) {
          e.preventDefault();
          setTab(this);
          tabs.slide(parseInt(this.getAttribute('data-tab'), 10), 300);
      }
  }
  </code></pre>