可计算值

问题描述 投票:-1回答:1

此代码中还有什么

   var b1 = 2;
    $(".column-1").each(function(i, val) {
      if ($(this).text() == "2019") {
        $(this).siblings('.column-3').each(function(){
         if($(this).text() !==''){
           var r +=parseInt($(this).text());
           alert(r);
          }
        
      });
      }
      });

如何解决此代码中的错误

jquery siblings
1个回答
0
投票

var b1 = 0;
$(".column-1").each(function(i, val) {
  if ($(this).text() == "2019") {
    var r=0;
    $(this).siblings('.column-3').each(function() {
               if($(this).text() !==''){
           r +=parseInt($(this).text());
           alert(r);
          }
    });
  }
  });
  

我解决了这个错误

© www.soinside.com 2019 - 2024. All rights reserved.