亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何使用.reet()方法使用jQuery重置表單

如何使用.reet()方法使用jQuery重置表單

收到一只叮咚 2019-07-26 15:14:14
如何使用.reet()方法使用jQuery重置表單我有工作代碼,當我點擊重置按鈕時,可以重置我的表單。然而,在我的代碼變得越來越長之后,我意識到它不再工作了。 <div id="labels">         <table class="config">             <thead>                 <tr>                     <th colspan="4"; style= "padding-bottom: 20px; color:#6666FF; text-align:left; font-size: 1.5em">Control Buttons Configuration</th>                 </tr>                 <tr>                     <th>Index</th>                     <th>Switch</th>                     <th>Response Number</th>                     <th>Description</th>                 </tr>             </thead>             <tbody>                 <form id="configform" name= "input" action="#" method="get">                 <tr><td style="text-align: center">1</td>                     <td><img src= "static/switch.png" height="100px" width="108px"></td>                     <td id="small"><input style="background: white; color: black;" type="text" value="" id="number_one"></td>                     <td><input style="background: white; color: black;" type="text"  id="label_one"></td>                 </tr>                 <tr>                     <td style="text-align: center">2</td>                     <td><img src= "static/switch.png" height="100px" width="108px"></td>                     <td id="small"><input style="background: white; color: black;" type="text" id = "number_two" value=""></td>                     <td><input style="background: white; color: black;" type="text"  id = "label_two"></td>                 </tr>                 <tr>                     <td style="text-align: center">3</td>                     <td><img src= "static/switch.png" height="100px" width="108px"></td>                     <td id="small"><input style="background: white; color: black;" type="text" id="number_three" value=""></td>                     <td><input style="background: white; color: black;" type="text" id="label_three"></td>                 </tr>而.reset()方法起作用了。這可能是其中一個原因嗎?
查看完整描述

3 回答

?
慕田峪4524236

TA貢獻1875條經驗 獲得超5個贊

您可以嘗試使用觸發器()參考鏈接

$('#form_id').trigger("reset");


查看完整回答
反對 回復 2019-07-27
?
元芳怎么了

TA貢獻1798條經驗 獲得超7個贊

根據這個職位這里,jQuery沒有reset()方法,但本機JavaScript可以。因此,可以使用以下兩種方法將jQuery元素轉換為JavaScript對象:

$("#formId")[0].reset()// or$("#formId").get(0).reset()


查看完整回答
反對 回復 2019-07-27
  • 3 回答
  • 0 關注
  • 454 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號