当条件满足时,如何在每个方法中突破以下jquery;
var rainbow = {'first' : 'red', 'second' : 'orange', 'third' : 'yellow'};
$.each(rainbow, function (key, color) {
if (color == 'red') {
//do something and then break out of the each method
alert("i'm read, now break.");
}
});
Run Code Online (Sandbox Code Playgroud)