前端 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>

 

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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM