title: JavaScript Validation Else If not working - alert for If is, else is not
body: <p>So I'm making a dynamic table which takes inputs for values of a Miles to Kilometers table.  My HTML works fine, and my functions for the displaying of the table works fine, however when adding validation to this to make sure that negative Integers cannot be inputted, the if statement in my for loop works, but the else statements break the code.  I am extremely confused as to why.</p>
  
  <p>Here is my JS code:</p>
  
  <pre><code>  for (var i = from; i &lt;= to; i++) {
      tr = document.createElement("tr");
      if (i &lt;= -1)
        alert("Value must be positive Integer");
      else if (i % 2 == 0)
        tr.setAttribute("class", "even");
      else
        tr.setAttribute("class", "odd");
  </code></pre>
  
  <p>It is the if else which does not work.  I'd be grateful for some help!</p>