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);
Sign in to make a reply
用户9706266415
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);