Discuss / JavaScript / 来个清真点的方法

来个清真点的方法

Topic source

_mundane

#1 Created at ... [Delete] [Delete and Lock User]

var obj = {}; $('#test-form :input:not(button)') .map(function() { if(this.name==='gender' && !this.checked) { return;
} obj[this.name] = this.value; }); json = JSON.stringify(obj);

5080sy

#2 Created at ... [Delete] [Delete and Lock User]

这应该是满分吧? 感谢!


  • 1

Reply