小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

表單

 頭號(hào)碼甲 2021-10-31

北冥復(fù)習(xí)html(三)

一、表單介紹

概念:表單是一個(gè)包含表單元素的區(qū)域,表單元素是允許用戶在表單中輸入內(nèi)容。

作用:提交用戶輸入的數(shù)據(jù)至服務(wù)端

二、結(jié)構(gòu)

<form action = " " method = " get " enctype = " ">
<table border = 1></table>

 

解釋:

  • form ==》 聲明一個(gè)表單
  • action ==》 向何處發(fā)送數(shù)據(jù)
  • method ==》 提交方式:get----明文發(fā)送; post----安全不可見 

三、元素

action:  向何處發(fā)送數(shù)據(jù)

data:  供自動(dòng)插入數(shù)據(jù)

input:    表單元素,里面有 type = 類型,name = 名字,value = 默認(rèn)存放數(shù)據(jù),size = 長度,maxlength = 表單元素最大輸入值,checked = 指定表單元素是否選中

以實(shí)例說明吧,簡(jiǎn)單明了:

1、登錄

    <from method = "post" action = "login.html">
        賬號(hào):<input type = "text"/><br/>
        密碼:<input type = "password"><br/>
        <input type = "reset" value = "重置"/>
    </from>

顯示效果:

 

 

2、性別選擇:

    <input name="sex" type="radio" value="男" checked/><input name="sex" type="radio" value="女" />

顯示效果:

 

 

3、興趣選擇

    <input type="checkbox" name="skill" value="talk" />演講
    <input type="checkbox" name="skill" value="code" checked/>編程
    <input type="checkbox" name="skill" value="manage" />管理 

顯示效果:

 

4、學(xué)歷選擇

    <select name="edu">
        <option value="1" selected="selected">小學(xué)</option>
        <option value="2">初中</option>
        <option value="3">高中</option>
        <option value="4">???span style="color: rgba(0, 0, 255, 1)"></option>
        <option value="5">本科</option>
    </select>

顯示效果:

 

5、按鈕

    <input type="reset" name="butReset" value="重置按鈕"/>
    <input type="submit" name="butSubmit" value="提交按鈕"/>
    <input type="button" name="butButton" value="普通按鈕"/>

顯示效果:

 

 

6、多文本域

<textarea name="show" cols="20" rows="10">文本內(nèi)容</textarea>

其中:cols 文本域?qū)挾?,rows 文本域高度

顯示效果:

 

7、郵箱

    <input type="email" name="myEmail"/>
    <input type="submit" value="提交" />
    

顯示效果:

 

8、年齡

    <input type="number" name="age" min="1" max="100" step="1" />
    <input type="submit" />

顯示效果:

 

9、音量

    <input type="range" name="range1" min="0" max="100" step="1" />
    <input type="submit" />

顯示效果:

 

10、關(guān)鍵字

    <input type="search" name="so" />
    <input type="submit" />

顯示效果:

你輸入內(nèi)容的時(shí)候,搜索框后邊會(huì)自動(dòng)出現(xiàn)一個(gè)小×,點(diǎn)擊這個(gè)小×,可以清除輸入的內(nèi)容。

 

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(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)論公約