title: print a range of numbers with different colors in JavaScript
body: <p>How should you print a range of numbers with different colors in an HTML page? E.g.: 1-10 red, 11-20 blue. I tried this, but it doesn't work.</p>
  
  <pre><code>&lt;html&gt;
      &lt;body&gt;
          &lt;script&gt;
              for(i=0;i&lt;=100;i++) {
                 document.write(i);
                 if(i&gt;30 &amp;&amp; i&lt;50) {
                     document.write(i,'&lt;FONT COLOR="red"&gt;');
                 }
              }
          &lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>