我想更改復選框的值,但因以下代碼而失敗。$("input:checkbox").on("change", function () { if (this.checked == true) { this.val("1"); } else { this.val("0"); }});我不知道為什么沒有代碼就沒有響應,當我調用這個元素時它應該“檢查”,但是沒有。所以我需要手動添加一個值字段。<input class="c-switch-input" type="checkbox" name="pk_{{$d['id']}}" value="{{$d['status']}}">
如何在更改時更改復選框的值
翻過高山走不出你
2023-09-21 17:01:33