form標簽里面的東西
二、效果圖!DOCTYPE html html head title Form.html /title meta name= keywords content= keyword1,keyword2,keyword3 meta name= description content= this is my page meta name= content-type content= text/html; charset=UTF-8 !-- link rel= stylesheet type= text/css href= ./styles.css -- /head body This is my HTML page. form action= !-- 必須要有name和value屬性,不然服務器無法獲取數據,name是組件的名字, name是提交服務器是服務對這個數據的鍵值,value是這個組件的值 輸入名稱: input type= text name= user value= br / 輸入密碼: input type= password name= pwd / br / !-- checked是默認選擇,默認選擇女,用戶少點一步,很方便,后面還有selected也是默認選擇的意思 -- 選擇性別: input type= radio name= sex value= nan / 男 input type= radio name= sex value= nv checked= checked / 女 br / 選擇技術: input type= checkbox name= tech value= java / JAVA input type= checkbox name= tech value= html / HTML input type= checkbox name= tech value= css / CSS br / !-- 選擇文件這個功能特別方便 -- 選擇文件: input type= file name= file / br / !-- 圖片組件,擁有提交功能 ,在我們需要用自制的提交按鈕時用,畢竟默認的太丑 -- 一個圖案: input type= image src= 11.jpg / br / !-- 隱藏組件,數據用戶不需要知道,但是可以將其提交到服務器,比如你算出來的數據 -- 隱藏組件: input type= hidden name= myke value= nyvalue / br / !-- 用于自定義功能的按鈕組件, quot;alert( 有個按鈕 ) ,單雙引號嵌套,alert彈出對話框 -- 一個按鈕: input type= button value= 有個按鈕 quot;alert( 有個按鈕 ) / br / !-- 上面是input組件,里面有10個屬性,下面看select屬性 -- select name= country option value= none --選擇國家-- /option option value= usa 美國 /option option value= en 英國 /option option value= cn 中國 /option /select br / !-- textarea屬性,比如說寫個人簡介的時候,賊好用 -- textarea rows= cols= name= text /textarea br / input type= reset value= 清除數據 / br / input type= submit value= 提交數據 / br / /form /body /html
以上就是關于HTML中表單組件的具體介紹的詳細內容,html教程
鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。
新聞熱點
疑難解答