Is there a way to go to the next element in jQuery .each()?
$(".row").each( function() {
if ( ... )
//go to next iteration in .each()
});
Thanks
Is there a way to go to the next element in jQuery .each()?
$(".row").each( function() {
if ( ... )
//go to next iteration in .each()
});
Thanks
Try this:
$(".row").each( function() {
if ( ! ... ) {
... do everything else ...
}
});
Or:
$(".row").each( function() {
if ( ... )
return; //go to next iteration in .each()
});
var rows = $(".row").each( function(idx) {
var nextRow = rows.eq(idx + 1);
});
You just need make a return to exit from anonymous function and go to next iteration.
$(".row").each( function() {
if ( ... )
return; //go to next iteration in .each()
});