HTML5-表單新功能 1.新增控制元件型別
阿新 • • 發佈:2019-02-09
email輸入型別 <input type="email" name="email">
此型別要求輸入格式正確的Email地址,否則瀏覽器是不允許提交的,並會有一個錯誤資訊提示,此型別在opea中必須指定name值,否則無效。
URL輸入型別 <input type="url" name="url">
上面程式碼展示的文字域要求輸入格式正確的URL地址,開始處新增http://
日期時間相關輸入型別
<input type="date" name="date"> <input type="time" name="time">
<input type="month" name="month"> <inpue type="week" name="week">
number輸入型別 <input type="number" name="number">
上面程式碼展示的文字域要求輸入格式正確的數字
search輸入型別 <input type="tel" name="tel">
此型別要求輸入一個電話號碼
color輸入型別 <input type="color" name="color">
此型別可讓使用者通過顏色選擇器選擇一個顏色值,並反饋到value中