title: Javascript element.style.opacity is undefined. Why?
body: <p>I am trying to make a JS function that flickers an element. I use a <code>setInterval()</code> for timing, but it gives the error message <code>Uncaught TypeError: Cannot read property 'opacity' of undefined</code>.</p>
  
  <p>When I try to modify the opacity not with a timer, but "by hand", that works...</p>
  
  <p>What am I doing wrong?</p>
  
  <p><strong>Usage:</strong></p>
  
  <pre><code>document.getElementById('idOfTheElement').startFlicker();
  </code></pre>
  
  <p><strong>The function:</strong></p>
  
  <pre><code>Element.prototype.startFlicker = function() {
      var blinkInterval = setInterval(function() {
          if (parseInt(this.style.opacity) === 0) {
              this.style.opacity = 1;
          } else {
              this.style.opacity = 0;
          }
      }, 50);
  };
  </code></pre>