How to handle change of checkbox using jQuery?

后端 未结 7 1850
失恋的感觉
失恋的感觉 2020-12-02 15:02

I have some code




7条回答
  •  攒了一身酷
    2020-12-02 15:26

    $('#myForm').on('change', 'input[type=checkbox]', function() {
        this.checked ? this.value = 'apple' : this.value = 'pineapple';
    });
    

提交回复
热议问题