How do I break out of Jquery's each
Loop?
I have tried
Return false;
in the loop but this did not work. Any ideas?
How do I break out of Jquery's each
Loop?
I have tried
Return false;
in the loop but this did not work. Any ideas?
According to the documentation return false should do the job.
Return false in the callback:
function callback(indexInArray, valueOfElement) {
var booleanKeepGoing;
this; // == valueOfElement (casted to Object)
return booleanKeepGoing; // optional, unless false
// and want to stop looping
}