title: Variables in JavaScript: An error arrives
body: <p>When I am starting my website, the JavaScript does not work. Safari gives an error:</p>
  
  <blockquote>
    <p>TypeError: 'null' is not an object (evaluating 'document.getElementById("aktuell").innerHTML')</p>
  </blockquote>
  
  <p>This is my JavaScript-code:</p>
  
  <pre><code>&lt;script&gt;
  var aktueller = document.getElementById("aktuell").innerHTML;
  function go() {
      neu = aktueller - 1;
      document.getElementById("aktuell").innerHTML = neu;
      if (neu == 1) {
          document.getElementById("zweite").style.display = 'none';
          document.getElementById("dritte").style.display = 'none';
      }
      else if (neu == 2) {
          document.getElementById("dritte").style.display = 'none';
      }
      else if (neu == 0) {
          document.getElementById("erste").style.display = 'none';
          document.getElementById("zweite").style.display = 'none';
          document.getElementById("dritte").style.display = 'none';
      }
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>And this is my used body-part:</p>
  
  <pre><code>&lt;body&gt;
  &lt;p id="aktuell" style="display:none;" &gt;0&lt;/p&gt;
  &lt;center&gt;
      &lt;button&gt;Zur&amp;uuml;ck&lt;/button&gt;&lt;button onclick="go();"&gt;Weiter&lt;/button&gt;
  &lt;/center&gt;
  &lt;div id="nullte"&gt;&lt;img src="data/nullte.jpg" width="500px" /&gt;&lt;/div&gt;
  &lt;div id="erste"&gt;&lt;img src="data/erste.jpg" width="500px" /&gt;&lt;/div&gt;
  &lt;div id="zweite"&gt;&lt;img src="data/zweite.jpg" width="500px" /&gt;&lt;/div&gt;
  &lt;div id="dritte"&gt;&lt;img src="data/dritte.jpg" width="500px" /&gt;&lt;/div&gt;
  &lt;/body&gt;
  </code></pre>