2948 explained code solutions for 75 technologies


jqueryBreak each() function loop


$('div').each(function() {
  if ( $(this).hasClass('.error') ) return false;
});ctrl + c
'div'

elements selector to loop through (all divs in our case)

each(

loop through all found elements

$(this).hasClass('.error')

condition to break the loop

return false

if we return false, each() will stop iterating