属性値を取得しています。私は多次元配列に設定する必要がありますが、エラーを表示しています。どこが間違っているの?あなたはそれにプロパティを設定する前に、まずこのオブジェクトを初期化する必要があるためjquery多次元配列を設定
var myArray = [];
amount=10;
x=1
$(id).closest('td').nextAll().find('input').each(function (n) {
myArray[x]['id'] = $(this).attr('data-id');
myArray[x]['year'] = $(this).attr('data-year');
myArray[x]['month'] = $(this).attr('data-month');
myArray[x]['amount'] = amount;
x++;
});
console.log(myArray);
[X] [「キー」] myarrayのを使用して、キーを更新するように明示的に、空のオブジェクトを割り当てる必要がある[それを介して2次元配列とループを作成しますjquery](http://stackoverflow.com/questions/26140640/create-two-dimensional-array-and-loop-through-it-in-jquery) –