jquery each loop only looping once and if using else code stops
<p>I've got two problems with the following javascript and jquery code.
The jquery each loop only iterates once, it gets the first element with the right ID does what it needs to do and stops.</p>

<p>The second problems is that when I use the else in the code the one inside the each function, it doesn't even tries the next if, it just exits there.
I'm probably doing something fundamental wrong, but from the jquery each function and what I'd expect from an else, I don't see it.</p>

<p>Javascript code:</p>

<pre><code>var $checkVal;
var $checkFailed;

$("#compliance").live("keypress", function (e) {

 if (e.which == 10 || e.which == 13) {
    var checkID = $(this).parents('td').next().attr('id');
    var checkVal = $(this).val();
    $('#' + checkID).each(function () {
        var cellVal = $(this).text();
        if (checkVal == cellVal) {
            $(this).removeClass("compFail").addClass("compOk");
        } else {
            $(this).removeClass("compOk").addClass("compFail");
            var checkFailed = True;
        }
    });
    if (checkFailed == 'True') {
        (this).addClass("compFail");
    } else {
        (this).addClass("compOk");
    }
 }
});
</code></pre>

<p>How could I get the each loop to iterate through all instances of each element with the id assigned to the variable checkID, and get the code to continue after the else, so it can do the last if?</p>
