1. 程式人生 > >表單 語義化標籤

表單 語義化標籤

input 文字輸入

相關程式碼:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form action="">
    <!--電子郵件-->
    <input type="email" name="email">
    <!--電話-->
    <input type="tel"
name="tel">
<!--網址--> <input type="url" name="url"> <!--搜尋框--> <input type="search" name="search"> <!--最小,最大取值 間隔取值 step 步長--> <input type="number " name="number" min="-10" max="10" step="any"> <input type="submit"> </form>
</body> </html>

input 資料選擇

相關程式碼:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form action="">
    <!--數值選擇器-->
    <input type="range" name="range"><br>
<!--顏色 提交的引數為十六進位制--> <input type="color" name="color"><br> <!--時間 --> <input type="datetime-local" name="datetime-local"><br> <!--placeholder 輸入提示資訊 autofocus 獲取焦點 autocomplete 預設為on(off)--> <input type="text" name="text" placeholder="請輸入相關資訊" autofocus> <!--required 驗證類 不能為空--> <input type="password" name="paw" required> <input type="submit"><br> </form> </body> </html>