Discuss / JavaScript / 挺头痛的

挺头痛的

Topic source

var obj = {}; $('#test-form :input').slice(0, 6).map(function () { obj[this.name] = this.value; }); $('#test-form :checked').first().map(function () { obj[this.name] = this.value; }); json = JSON.stringify(obj);


  • 1

Reply