日韩黑丝制服一区视频播放|日韩欧美人妻丝袜视频在线观看|九九影院一级蜜桃|亚洲中文在线导航|青草草视频在线观看|婷婷五月色伊人网站|日本一区二区在线|国产AV一二三四区毛片|正在播放久草视频|亚洲色图精品一区

分享

WEB前端——body內(nèi)常用標(biāo)簽(form標(biāo)簽)

 小世界的野孩子 2021-09-19

一、form標(biāo)簽介紹

語(yǔ)義:標(biāo)記表單

#1、什么是表單?
    表單就是專門用來(lái)接收用戶輸入或采集用戶信息的

#2、表單的格式
    <form>
        <表單元素>
    </form>

二、form標(biāo)簽的屬性

三、input

 四、label

 五、textarea

六、select

 七、補(bǔ)充

在form內(nèi)還可以添加一種標(biāo)簽
<fieldset>添加邊框
    <legend>注冊(cè)頁(yè)面</legend>
    表單控件......
</fieldset>

八、練習(xí)

1、練習(xí)1

<html>
    <head>
        <title>表單練習(xí)</title>
        <meta charset="utf-8"/>
    </head>
    <body>
        <form action="http://www.baidu.com">
            <fieldset>
                <legend>注冊(cè)頁(yè)面</legend>
                <p>
                    賬號(hào):<input type="text" placeholder="請(qǐng)輸入你的用戶名" name="user">
                </p>

                <p>
                    密碼:<input type="password" placeholder="請(qǐng)輸入你的密碼" name="password">
                </p>

                <p>
                    性別:
                    <input type="radio" name="gender" value="male"><input type="radio" name="gender" value="female"><input type="radio" name="gender" checked="checked" value="none">保密
                </p>

                <p>
                    <!--注意點(diǎn):?jiǎn)芜x框or復(fù)選框都需要指定相同的name值-->
                    愛(ài)好:
                    <input type="checkbox" name="sport" value="basketball">籃球
                    <input type="checkbox" name="sport" value="football">足球
                    <input type="checkbox" checked="checked" name="sport" value="crazy">足浴
                </p>

                <p>
                    簡(jiǎn)介:
                    <textarea name="" id="" cols="30" rows="10" name="desc"></textarea>
                </p>

                <p>
                    生日:
                    <input type="date" name="birth">
                </p>

                <p>
                    郵箱:
                    <input type="email" name="email">
                </p>

                <p>
                    電話:
                    <input type="number" name="phone">
                </p>

                <p>
                    <input type="submit" value="注冊(cè)">    
                    <input type="reset" value="清空">
                </p>

            </fieldset>
        </form>

    </body>
</html>
練習(xí)1

2、練習(xí)2

<html>
<head>
    <meta charset="utf-8"/>

    <script src="https://cdn./jquery/3.3.1/jquery.js"></script>
    <script>
        $(document).ready(function () {
            $('#my-img').click(function () {
                $('#img-upload').click();
            });
        })
    </script>

    <style>
        #img-upload {
            display: none;
        }
    </style>

</head>
<body>
<form action=""  method="post" enctype="multipart/form-data">
    <input type="text" name="user">用戶名
    <input type="text" name="pwd">密碼

    <div>
        <img id="my-img" src="aaa/a.jpeg" alt="" width="100px">
        <input id="img-upload" type="file" name="上傳頭像">
    </div>

    <input type="submit" value="提交">
</form>
</body>
</html>
練習(xí)2:改變input type=file的內(nèi)容

 

九、快捷鍵

 
p#d1.c1
補(bǔ)全完整 
<p id="d1" class="c1"></p>

div#d2.c2
補(bǔ)全完整
<div id="d2" class="c2"></div>

 

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多