0

作成後にこのコードが見つかりました

<table> ... content ...
</ tables>

...ループ "FOR" の "j" の累積値が必要です...

var dt = $(".table thead th").length;
for (var i = 0; i < dt; ++i) {
    (function (j) {
        var dt = $(".table thead th").length;
        $(".table thead").each(function () {
            var $ths = $(this).find('th');
            if ($ths.length != 0 && $ths.eq(j).text() != "Estado" && $ths.eq(j).text() != "ESTADO" && $ths.eq(j).text() != "Acciones" && $ths.eq(j).text() != "ACCIONES") {
                j = j + ",";  // I need this value, the value to be displayed is something like this: 0,1,2,3 ...
                alert(j);
            }
        });
        return j;
    })(i);
}

/* I need the value of "j" here, but this does not work */
var variable = j;
alert(variable);
4

3 に答える 3