how to get multiple checkbox value using jquery

前端 未结 12 771
终归单人心
终归单人心 2020-11-29 20:11

How can I get the value of checkboxes which are selected using jquery? My html code is as follows:



        
12条回答
  •  醉话见心
    2020-11-29 20:21

    try this one.. (guys I am a new bee.. so if I wrong then I am really sorry. But I found a solution by this way.)

    var suggestion = [];
    $('#health_condition_name:checked').each(function (j, ob) {
    
        var odata = {
            health_condition_name: $(ob).val()
        };
    
        health.push(odata);
    });
    

提交回复
热议问题