title: Reduce opacity throught setInterval
body: <p>I tried too write simple function similar to fadeOut from jQuery, but stuck. Everything works, but opacity reduces from 0.02 not from 1, as I write in css. Inspecting code by console.log() show on first step empty, then -0.02, -0,04. Here is my code css: </p>
  
  <pre><code>#box {
    background: red;
    height: 200px;
    opacity:1;
    width: 200px;
  }
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code> var box = document.getElementById("box");
  
   setInterval(function() {
    console.log(box.style.opacity);
    box.style.opacity -= 0.02;
   }, 1000)
  </code></pre>
  
  <p>Here is codepen <a href="http://codepen.io/Kuzyo/pen/xDc" rel="nofollow">http://codepen.io/Kuzyo/pen/xDc</a>
  Can somebody explain whats going on. Thanks.</p>