title: array with javascript won't use list correctly
body: <p>I have code here and I'm wondering why if inputed let's say 400 or 700... it won't go to those particular places. It just goes to range of  $200 - $299.</p>
  
  <p>I couldn't find the error.. Please help out
  .............</p>
  
  <pre><code>&lt;!DOCTYPE&gt;
  &lt;html&gt;
  
  &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;10.10&lt;/title&gt;
  
      &lt;style type = "text/css"&gt;
  
           table, table td   { padding: 5px }
  
      &lt;/style&gt;
  
      &lt;script type = "text/javascript"&gt;
          var counters = [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ];
          function submitSales()
          {   
              var salary = 0;
              var grossSales = parseInt( document.getElementById( "grossField" ).value );
              if ( isNaN( grossSales ) )
              {
                  window.alert( "Invalid gross entered!" );
                  return;
              }
              salary = 200 + parseInt( ( .09 * grossSales ) );
              if ( salary &gt;= 200 &amp;&amp; salary &lt;= 299 )
                  ++counters[ 0 ];
              if ( salary &gt;= 300 &amp;&amp; salary &lt;= 399 )
                  ++counters[ 1 ];
              if ( salary &gt;= 400 &amp;&amp; salary &lt;= 499 )
                  ++counters[ 2 ];
              if ( salary &gt;= 500 &amp;&amp; salary &lt;= 599 )
                  ++counters[ 3 ];
              if ( salary &gt;= 600 &amp;&amp; salary &lt;= 699 )
                  ++counters[ 4 ];
              if ( salary &gt;= 700 &amp;&amp; salary &lt;= 799 )
                  ++counters[ 5 ];
              if ( salary &gt;= 800 &amp;&amp; salary &lt;= 899 )
                  ++counters[ 6 ];
              if ( salary &gt;= 900 &amp;&amp; salary &lt;= 999 )
                  ++counters[ 7 ];
              if ( salary &gt;= 1000 )
                  ++counters[ 8 ];
              displayResults();
              document.getElementById( "grossField" ).value = "0";
          }
          function displayResults()
          {   
              var printoutTable = "&lt;table border = \"1\"&gt;";
              printoutTable += "&lt;tr&gt;&lt;td colspan = \"2\" style = \"text-align: center\"&gt;&lt;h1&gt;Weekly Salary Range Report&lt;/h1&gt;&lt;/td&gt;&lt;/tr&gt;";
              printoutTable += "&lt;tr&gt;&lt;td&gt;Range&lt;/td&gt;&lt;td&gt;Number of Employees&lt;/td&gt;&lt;/tr&gt;";
              printoutTable += "&lt;tr&gt;&lt;td&gt;$200-299&lt;/td&gt;&lt;td&gt;" + counters[ 0 ] + "&lt;/td&gt;&lt;/tr&gt;";
              printoutTable += "&lt;tr&gt;&lt;td&gt;$300-399&lt;/td&gt;&lt;td&gt;" + counters[ 1 ] + "&lt;/td&gt;&lt;/tr&gt;";
              printoutTable += "&lt;tr&gt;&lt;td&gt;$400-499&lt;/td&gt;&lt;td&gt;" + counters[ 2 ] + "&lt;/td&gt;&lt;/tr&gt;";
              printoutTable += "&lt;tr&gt;&lt;td&gt;$500-599&lt;/td&gt;&lt;td&gt;" + counters[ 3 ] + "&lt;/td&gt;&lt;/tr&gt;";
              printoutTable += "&lt;tr&gt;&lt;td&gt;$600-699&lt;/td&gt;&lt;td&gt;" + counters[ 4 ] + "&lt;/td&gt;&lt;/tr&gt;";
              printoutTable += "&lt;tr&gt;&lt;td&gt;$700-799&lt;/td&gt;&lt;td&gt;" + counters[ 5 ] + "&lt;/td&gt;&lt;/tr&gt;";
              printoutTable += "&lt;tr&gt;&lt;td&gt;$800-899&lt;/td&gt;&lt;td&gt;" + counters[ 6 ] + "&lt;/td&gt;&lt;/tr&gt;";
              printoutTable += "&lt;tr&gt;&lt;td&gt;$900-999&lt;/td&gt;&lt;td&gt;" + counters[ 7 ] + "&lt;/td&gt;&lt;/tr&gt;";
              printoutTable += "&lt;tr&gt;&lt;td&gt;$1000+&lt;/td&gt;&lt;td&gt;" + counters[ 8 ] + "&lt;/td&gt;&lt;/tr&gt;";
              printoutTable += "&lt;/table&gt;";
              document.getElementById( "salesPrintout" ).innerHTML = printoutTable;
  
          }
      &lt;/script&gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
  
      &lt;form action = ""&gt;
          &lt;table&gt;
              &lt;tr&gt;
                  &lt;td colspan = "2" style = "text-align: center"&gt;&lt;h1&gt;Employee Gross Sales:&lt;/h1&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;Gross Sales: &lt;/td&gt;
                  &lt;td&gt;$&lt;input id = "grossField" type = "text" /&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td /&gt;
                  &lt;td&gt;&lt;input type = "button" value = "Submit Sales"
                      onclick = "submitSales()" /&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
          &lt;div id = "salesPrintout"&gt;
              &lt;table border = "1"&gt;
                  &lt;tr&gt;&lt;td colspan = "2" style = "text-align: center"&gt;&lt;h1&gt;Weekly Salary Range Report&lt;/h1&gt;&lt;/td&gt;&lt;/tr&gt;
                  &lt;tr&gt;&lt;td&gt;Range&lt;/td&gt;&lt;td&gt;Number of Employees&lt;/td&gt;&lt;/tr&gt;
                  &lt;tr&gt;&lt;td&gt;$200-299&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;/tr&gt;
                  &lt;tr&gt;&lt;td&gt;$300-399&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;/tr&gt;
                  &lt;tr&gt;&lt;td&gt;$400-499&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;/tr&gt;
                  &lt;tr&gt;&lt;td&gt;$500-599&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;/tr&gt;
                  &lt;tr&gt;&lt;td&gt;$600-699&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;/tr&gt;
                  &lt;tr&gt;&lt;td&gt;$700-799&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;/tr&gt;
                  &lt;tr&gt;&lt;td&gt;$800-899&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;/tr&gt;
                  &lt;tr&gt;&lt;td&gt;$900-999&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;/tr&gt;
                  &lt;tr&gt;&lt;td&gt;$1000+&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;/tr&gt;
              &lt;/table&gt;
          &lt;/div&gt;
      &lt;/form&gt;
  
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>