參考:
jquery 表單 清空
$(':input','#myform')
.not(':button, :submit, :reset, :hidden')
.val('')
.removeAttr('checked')
.removeAttr('selected');
這個js是可以實現清空表單中填寫及傳入的值的,但要注意:
1、jq實現,此<input/>不能放在form表單內!;
2、直接寫在onclick屬性中即可
更多信息請查看IT技術專欄
2026國考·省考課程試聽報名