How can I exist from the whole jquery click event function if the condition is met inside $.each
. One solution would be storing condition result in a variable and then have an if statement after the loop but is not there a direct way?
$(".main").on("click",".button",function(e){
$(this).siblings('input').each(function(){
if($(this).val() == 'yourvalue') {
return false;
}
});
//......rest of the code runs if the above condition is NOT met
});