编辑下面的代码:【加编码】
<html> <head> <script> function formReset() { document.getElementById("frm1").reset(); } </script> </head> <body> <p>Enter some text in the fields below, then press the "Reset form" button to reset the form.</p> <form id="frm1"> First name: <input type="text" name="fname"><br> Last name: <input type="text" name="lname"><br><br> <input type="button" onclick="formReset()" value="Reset form"> </form> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂