前端 HTML form表單標籤 input標籤 type屬性 重置按鈕 reset

 

 

 

input type="reset" value="重置"
 
reset重置 還原到默認狀態
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="x-ua-compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Title</title>
</head>
<body>
    <form action="http://www.baidu.com" method="get">
        <div>
            <p>
                <input type="text" name="user">
            </p>
            <p>
                用戶性別
                男:<input type="radio" name="gender" value="1" checked="checked">
                女:<input type="radio" name="gender" value="2">
            </p>
            <p>
                愛好
                籃球: <input type="checkbox" name="favor" value="1">
                足球: <input type="checkbox" name="favor" value="2">
                羽毛球: <input type="checkbox" name="favor" value="3">
                排球: <input type="checkbox" name="favor" value="4">
            </p>
            <p>
                技能
                寫代碼: <input type="checkbox" name="skill" value="1">
                寫代碼: <input type="checkbox" name="skill" value="2">
            </p>
        </div>

        <input type="submit" value="提交">
        <!-- 重置按鈕 -->
        <input type="reset" value="重置">
    </form>
</body>
</html>

 

 按下重置按鈕,還原到默認狀態html

相關文章
相關標籤/搜索