數組多個數據

var arr = [];

$('.thisPlaceholder').each(function(){

var test = {};

// console.log( $(this) );

if($(this).val()!=""){

if($(this).attr("data-id")!=undefined){

test.id = parseInt( $(this).attr("data-id") );

test.columnName = $(this).attr('name');

test.situation = $(this).val();

}else{

test.columnName = $(this).attr('name');

test.situation = $(this).val();

}

arr.push(test)

}

})

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章