Discuss / JavaScript / 练习

练习

Topic source

*花前

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

var data = {};

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

    if(this.type !== 'radio' || this.checked){

        data[this.name] = this.value;

    }

});

json = JSON.stringify(data);


  • 1

Reply