title: Javascript: Compare values in a table
body: <p>I'm currently learning JavaScript and completed some courses on Codecademy and Codeschool. I now know a little bit about how you write functions in JavaScript. I'm familiar with the if else statements etc, but there is one thing that I just can't get the hang on and that's why I'm hoping you  can help me with it and explain how it works so I can learn from it and use it myself in the future. I've searched a whole day yesterday and also tried a lot of things but it just doesn't work.</p>
  
  <p>I have a table which contains some values (jsfiddle included), these values are not static as they are in the example but will change everyday. 
  Basically what it is: it's a table which shows how many hours someone has to work and how many hours he had work. These values need to be compared to see if there is any difference. If there is a difference there should be a X in the checked row.</p>
  
  <p>In the JSfiddle I've put some JavaScript that doesn't work. But that's the idea I had about how I should be implementing it (I'm quite positive that it is something in that direction, but again I'm still a beginner). </p>
  
  <p>The thing that I still don't quite understand in JavaScript is how I implement this code in my HTML page so that it works. I don't know how to get a certain value from the table inside my comparison function.. if that makes sense?</p>
  
  <p>Anyway, this is the code <a href="http://jsfiddle.net/3JDQQ/1/" rel="nofollow noreferrer">http://jsfiddle.net/3JDQQ/1/</a></p>
  
  <pre><code>    window.onload = function check(a, b){ /* a and b should represent Hours a and Hours b, this hasnt been declarated */
      for(i = 1; i &lt;= id.length; i++){ /* id.lenght isnt a value I've declarated.  */
          if( a != b ){
              /* place nothing at check */
          } else {
              /* place a X at check */
          }
      }
  }
  </code></pre>
  
  <p>Click the fiddle for the whole code.
  The values that are put in there are static, but they are going to be dynamic. So I need a function that goes through these numbers every time I load the page.</p>