Nested jQuery.each() - continue/break

后端 未结 11 493
天涯浪人
天涯浪人 2020-12-05 03:52

Consider the following code:

    var sentences = [
        \'Lorem ipsum dolor sit amet, consectetur adipiscing elit.\',
        \'Vivamus aliquet nisl quis          


        
11条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-05 04:45

    return true not work

    return false working

    found = false;
    query = "foo";
    
    $('.items').each(function()
    {
      if($(this).text() == query)
      {
        found = true;
        return false;
      }
    });
    

提交回复
热议问题