HTML的表單元?

來源:互聯網
上載者:User

標籤:style   http   io   os   ar   for   檔案   資料   sp   

HTML的表單元素

表單元素是同意使用者在表單中(比方:文本域,下拉式清單,單選框,複選框等等)輸入資訊的元素

表單標籤


文本域(Text Fields)

當使用者要在表單中鍵入字母,數字等內容時,就會用到文本域

單選button(Radio Buttons)

當使用者從若干給定的的選擇中選取其一時,就會用到單選框

複選框(Checkboxes)

當使用者須要從若干給定的選擇中選取一個或若干選項時,就會用到複選框

表單的動作屬性(Action)和確認button

當使用者單擊確認button時,表單的內容會被傳送到還有一個檔案,表單的動作屬性定義了目的檔案的檔案名稱,由動作屬性定義的這個檔案一般會對接收到的輸入資料進行相關的處理

以下舉幾個範例

<html><head><title>Welcome</title></head><h1>登入</h1><form action="" method="post">使用者名稱:<input type="text" name="username"/><br/>密  碼:<input type="password" name="pwd"/></br><input type="submit" value="登入"/>  <input type="reset" value="又一次填寫"/></br><input type="checkbox" name="v1">西瓜</br><input type="checkbox" name="v1">蘋果</br><input type="radio" name="sex"/>男</br><input type="radio" name="sex"/>女</br><!--隱藏的用處是課提交資料,同一時候不影響介面--><input type="hidden" value="123" name="sal"/>選擇你的出生地:<select name="bir"><option value="">--請選擇--</option><option value="bj">北京</option><option value="bj">上海</option><option value="cq">重慶</option></select></br>請留言</br><textarea cols="30" rows="10"></textarea></br>選擇要上傳的檔案</br>請選擇檔案:<input type="file" name="myfile"/></br></select></form></body></html>

網頁開啟




HTML的表單元?

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.