&nbs"/> &nbs">
當表單被重設時,onreset 屬性會觸發。您可以嘗試執行以下程式碼來實作onreset屬性 −
<!DOCTYPE html> <html> <body> <form onreset = "display()"> Student Name:<br> <input type = "text" name = "sname"> <br> Student Subject:<br> <input type = "text" name = "ssubject"> <br> <input type = "reset" value = "reset"> </form> <script> function display() { alert("Form reset successfull!"); } </script> </body> </html>
以上是當在HTML中點擊表單中的重設按鈕時執行腳本?的詳細內容。更多資訊請關注PHP中文網其他相關文章!