表單補充,labed標籤,html5新增表單元素和語義
<h2>label標籤的使用</h2> <!--label標籤給予人們友好的操作,選中時,點中文字時自動選中文字框--> <label>使用者名稱:<input type="text"></label><br> <!--下面出現一種情況就是使用者名稱後面出現倆個文字框,如需要選中指定,則在標籤label加上for指示,在想選中的框中加上id即可--> <label for="second">使用者名稱:<input type="text" id="first"><input type="text" id="second"></label>
<form action="">
<!--表單新增元素-->
郵箱<input type="email"><br> 手機<input type="tel"><br> 數字<input type="number"><br> 網址<input type="url"><br> 搜尋<input type="research"><br> 區域<input type="range"><br> 時間<input type="time"><br> 年月日<input type="date"><br> 月份<input type="month" ><br> 星期<input type="week"><br> 顏色<input type="color"><br> <input type="submit"><br> </form>
<!--表單新增語義-->
使用者名稱:<input type="text" placeholder="請輸入使用者名稱" autofocus />
<!--placeholder效果一般用於提示填入什麼樣的資訊, autofocus表現上述文字框一開始預設選中--> 上傳頭像:<input type="file" multiple >
<!--加入multiple之後,按住Ctrl可以選中多個檔案--> <form action=""> 姓名:<input type="text" autocomplete="on" name="UserName" required accesskey="c">
<!--autocomplete 開啟表示上述文字框填入資訊,加上下面的submit提交鍵可以記住所填的資訊,具有記憶功能,一般自行操作就會明白,required表示此項必須填寫,不填寫提交會提醒,accesskey有類似快捷鍵的含義,按住Alt+c鍵即可快速選中所需的文字框,上述的語義一般與submit一起使用--> <input type="submit">
</form>