HTML <input type = "text">
例
ユーザーがテキストを入力できる単一行のテキストフィールドを定義します。
<label for="fname">First name:</label>
<input type="text"
id="fname" name="fname">
定義と使用法
は<input type="text">
、1行のテキストフィールドを定義します。
テキストフィールドのデフォルトの幅は20文字です。
ヒント:<label>
アクセシビリティのベストプラクティスのために、常にタグを追加してください。
ブラウザのサポート
Attribute | |||||
---|---|---|---|---|---|
type="text" | Yes | Yes | Yes | Yes | Yes |
構文
<input type="text">