title: Time validation (and comparing) using Javascript / JQuery
body: <p>First of all apologise for creating my third Javascript question in as many days - I'm really trying to push myself in this field on this project, and feel my skills are developing at a fairly good rate thanks to my research and your fantastic help on here, particularly redsuqare!!</p>
  
  <p>I've got a table where people can enter times, and have a mask in place where it'll check that the input is in the format 99:99 - which is great, but ideally I want to limit it to be no more than 23:59! </p>
  
  <p>Here's the code I have at the moment, cobbled together the best I can, but unsurprisingly doesn't work...</p>
  
  <pre><code>$.each($('#hoursavailable tr td :checkbox'), function() {
  
      var $this = $(elem); // cache the object
      var $row = $this.closest('tr'); // find the nearest table row
      if($this.is(':checked')) {
          // do nothing!
      } else {
          $row.each(':text'),function() {
              var splittime = $(this).split(":");
              if(splittime[0] &gt; 22 || splittime[1] &gt; 58) {
                  alert('please enter a valid date'); return false;
              }
          }
      }
  });
  </code></pre>
  
  <p>Could also be worth noting that there are two inputs per row/tr - it'd be absolutely ideal if I could somehow compare the two, to ensure that the first one is before the second, but appreciate that could be even more beyond me than the current stuff :(</p>
  
  <p>Thanks</p>