&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中文网其他相关文章!