Trigger change event of a checkbox
问题 I've 7 checkboxes (A,B,C,D,E,F,G) and when I click one of them, the value is appended to a textarea. If I uncheck one, the value is removed from the textarea. The jquery code is as below: var checkboxes = $("input[type='checkbox']"); checkboxes.on('change', function() { $('#recipient').val( checkboxes.filter(':checked').map(function(item) { return this.value; }).get().join('; ') ); }); The html code is as below: <div class="col-sm-5"> <div class="form-group"> <label>Recipient</label>