Discuss / JavaScript / 课后练习

课后练习

Topic source

json = {};

$('#test-form [name]').filter(function() {

    if(this.name && this.name !== 'gender' || this.checked){

        json[this.name]=this.value;

    }

});

json = JSON.stringify(json);


  • 1

Reply