溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

html5 input有什么新屬性

發(fā)布時間:2021-11-02 09:33:46 來源:億速云 閱讀:177 作者:iii 欄目:web開發(fā)

這篇文章主要講解了“html5 input有什么新屬性”,文中的講解內(nèi)容簡單清晰,易于學習與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學習“html5 input有什么新屬性”吧!

html5 input有新增屬性,分別為:autocomplete、autofocus、form、height、list、max、min、multiple、pattern、placeholder、required、step、width等等。

html5 input有什么新屬性

本教程操作環(huán)境:windows7系統(tǒng)、HTML5版、Dell G3電腦。

<input> 標簽規(guī)定了用戶可以在其中輸入數(shù)據(jù)的輸入字段。

<input> 元素在 <form> 元素中使用,用來聲明允許用戶輸入數(shù)據(jù)的 input 控件。

輸入字段可通過多種方式改變,取決于 type 屬性。

HTML5 input標簽新增屬性

屬性描述
autocompleteon offautocomplete 屬性規(guī)定 <input> 元素輸入字段是否應該啟用自動完成功能。
autofocusautofocus屬性規(guī)定當頁面加載時 <input>  元素應該自動獲得焦點。
formform_idform 屬性規(guī)定 <input> 元素所屬的一個或多個表單。
formactionURL屬性規(guī)定當表單提交時處理輸入控件的文件的 URL。(只針對 type="submit" 和 type="image")
formenctypeapplication/x-www-form-urlencoded multipart/form-data text/plain屬性規(guī)定當表單數(shù)據(jù)提交到服務器時如何編碼(只適合 type="submit" 和 type="image")。
formmethodget post定義發(fā)送表單數(shù)據(jù)到 action URL 的 HTTP 方法。 (只適合 type="submit" 和 type="image")
formnovalidateformnovalidateformnovalidate 屬性覆蓋 <form> 元素的 novalidate 屬性。
formtarget_blank _self _parent _topframename規(guī)定表示提交表單后在哪里顯示接收到響應的名稱或關鍵詞。(只適合 type="submit" 和 type="image")
heightpixels規(guī)定  <input>元素的高度。(只針對type="image")
listdatalist_id屬性引用  <datalist> 元素,其中包含 <input> 元素的預定義選項。
maxnumber date屬性規(guī)定 <input> 元素的最大值。
minnumber date屬性規(guī)定 <input>元素的最小值。
multiplemultiple屬性規(guī)定允許用戶輸入到 <input> 元素的多個值。
patternregexppattern 屬性規(guī)定用于驗證 <input> 元素的值的正則表達式。
placeholdertextplaceholder 屬性規(guī)定可描述輸入 <input> 字段預期值的簡短的提示信息 。
requiredrequired屬性規(guī)定必需在提交表單之前填寫輸入字段。
stepnumberstep 屬性規(guī)定 <input> 元素的合法數(shù)字間隔。
widthpixelswidth 屬性規(guī)定  <input> 元素的寬度。  (只針對type="image")

感謝各位的閱讀,以上就是“html5 input有什么新屬性”的內(nèi)容了,經(jīng)過本文的學習后,相信大家對html5 input有什么新屬性這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是億速云,小編將為大家推送更多相關知識點的文章,歡迎關注!

向AI問一下細節(jié)

免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權內(nèi)容。

AI