title: How to make dynamic background color?
body: <p>I've got a problem with this script. I don't know how to make dynamic rgb using this. I am javascript noob. I have used three vars and saved using getElementById. And I dont know how to save it to style from the spans. </p>
  
  <pre><code>            var i = 0;
      var ii = 20;
      var iii = 18;
  
  function increment() {
  
     i++;
      document.getElementById('number').innerHTML = i;
          if (i==255) {
  document.getElementById('number').innerHTML = i--;
  
  }
  }
      function increment2() { 
     ii++;
      document.getElementById('pica').innerHTML = ii;
          if (ii==255) {
  document.getElementById('pica').innerHTML = ii--;
  }
  }
      function increment3() { 
     iii++;
      document.getElementById('dick').innerHTML = iii;
          if (iii==255) {
  document.getElementById('dick').innerHTML = iii--;
  
  }
  }   
  
      setInterval('increment()', 50);
      setInterval('increment2()', 60);
    setInterval('increment3()', 55);
    var rgb = document.getElementById('rgb').innerHTML;   
    document.write(rgb);
  </code></pre>
  
  <p>And this is html:</p>
  
  <pre><code> &lt;div id="rgb"&gt;
   &lt;span id="number"&gt;&lt;/span&gt;
   &lt;span id="pica"&gt;&lt;/span&gt;
   &lt;span id="dick"&gt;&lt;/span&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>This is the rgb I need make dynamic:</p>
  
  <pre><code> &lt;div id="id" style="background-color: rgb(255,255,255); 
   width: 100%; height: 100%;"&gt;&lt;/div&gt;
  </code></pre>