Use the reset button to reset form information
When the user needs to reset the form information to the initial state, for example, after the user enters "user name" and finds a writing error, he can use the Reset button
to restore the input box to the initial state. Just set type to "reset".
grammar:
<input type="reset" value="Reset">
type
: Only when the type value is set to reset, the button has a reset function
value
:
The text displayed on the button
Example
:
Results displayed in browser:
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>重置按鈕</title> </head> <body> <form action="save.php" method="post" > <laber>你覺(jué)得我?guī)泦幔?lt;/laber><br /> <select> <option value="哎呀媽呀,賊帥了!"selected>哎呀媽呀,賊帥了!</option> <option value="最帥!">最帥!</option> <option value="宇宙無(wú)敵了!">宇宙無(wú)敵了!</option> <option value="無(wú)人能比了!">無(wú)人能比了!</option> </select> <input type="submit" value="確定" /> <input type="reset" value="重置" /> </form> </body> </html>