html5 新增 input 型別

2022-03-09 17:48:28 字數 1786 閱讀 2086

input 新增型別

email/url/number/range/date picker/search/color/tel

date picker

date--選取日、月、年

month--選取月、年

week--選取周、年

time--選取時間(小時和分鐘)

datetime--選取時間、日、月、年(utc時間)

datetime-local--選取時間、日、月、年(本地時間)

例子:姓名:

性別:男女

出生日期:date'>

出生月份:month'>

出生週數:week'>

range/search/color

請選擇您需要的數值 ,數值的範圍是最大100,最小10:

range' min='10' max='100' >

請選擇您喜歡的顏色 :

color'>

請輸入要搜尋的內容 :

search'>

表單屬性

autocomplete/autofocus/multiple/placeholder/required

autocomplete//輸入框提示之前輸入的內容

autofocus//開啟頁面後,可以馬上輸入內容,不需要再點選輸入框再輸入

使用者名稱:autofocus="autofocus">

請輸入密碼:

multiple//選擇多個檔案或者內容,在email內設定,用逗號分開郵箱

multiple="multiple">

multiple="multiple">

placeholder//   文字輸入前有提示框,提示輸入的內容,輸入錯後,旁邊會有乙個x可以刪除所有

required//規定必須在提交之前填寫輸入域(不能位空)

required="required">

鏈結屬性

sizes屬性/target屬性/超連結

//在heard 之間     可以使網頁下所有a標籤不用輸入那麼多路徑的名字,直接輸入名字即可

a:media=""    //表示對裝置進行優化,handheld對「手持」裝置進行支援,tv對「電視」裝置進行支援

a:hreflang="zh"  //設定語言

a:rel="external"    //設定超連結的引用,這裡超連結為外部鏈結

其他屬性

script/ol/html/style

script

defer:載入完指令碼後並不執行,而是等整個頁面載入完後再執行  只相容ie

async:載入完指令碼後立刻執行,不用等整個頁面都載入完,屬於非同步執行   相容主流瀏覽器

olstart起始值reversed倒序排列

manifest="cache.maniest">

HTML5新增input型別

發表於 2016 06 16 分類於 前端 閱讀次數 4在html4等早期版本中,input元素已經有了一些type型別,type可取的值有下面這些 text文字型別 password密碼型別 radio 單選型別 選項 checkbox 多選型別 選項 file 檔案型別 submit 提交按鈕 ...

HTML5新增input表單

html5新增input表單 input表單及其屬性 type email 限制使用者輸入必須為e mail型別 type url 限制使用者輸入必須為 和 型別 type date 限制使用者輸入必須為日期型別 type month 限制使用者輸入必須為月份型別 type time 限制使用者輸入...

html5學習筆記二 新增input 型別

email 244680111 qq.com url 數字min最小值 max最大值 input 型別 range range 型別用於應該包含一定範圍內數字值的輸入域。range 型別顯示為滑動條。您還能夠設定對所接受的數字的限定 input 型別 date pickers 資料檢出器 html ...