var arr = []; //populate the length of children into this array.
$('ul').map(function (i) {
arr[i] = $(this).children().length;
});
var maxValue = Math.max.apply(Math, arr); //get the max value from the array
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
751 次 |
| 最近记录: |