検索

HTMLフォーム入力タイプ

Sep 04, 2024 pm 04:53 PM
htmlhtml5HTML TutorialHTML PropertiesHTML tags

HTML の タグは、ユーザー側からデータを受け入れるための Web フォーム内の対話型コントロールを設計するために使用されます。使用するユーザー エージェントとデバイスに応じて、さまざまな種類のコントロール ウィジェットと入力データを利用できます。 タグは、属性と入力タイプの組み合わせが非常に多いため、HTML 全体で使用される最も重要な要素の 1 つです。このトピックでは、HTML フォーム入力タイプについて学習します。

HTMLフォーム入力タイプ

タグは HTML

の重要な要素です。要素。 内の「type」属性タグにはさまざまなタイプがあり、 などの情報フィールドを定義するために使用されます。テキストボックスを提供します。 のデフォルトのタイプ。タグはテキストです。

HTML で使用できる「入力」の種類のリスト

Type Description Format Example
button Used to define a push button with the text of the button being the value of the value attribute. HTMLフォーム入力タイプ


checkbox Used to define a checkbox allowing users to select/deselect its values. HTMLフォーム入力タイプ


Cricket
Tennis
Football
file Used to define a file upload feature on the local system with the accept attribute being used to restrict the file types for upload. HTMLフォーム入力タイプ


<input type="file" name="newfile">

hidden Used to hide a control whose value will be submitted on the server. There is an example in the next column, but it’s hidden!
image A graphical submit button — displaying an image defined with the src attribute. The alt attribute displays if the image src is missing. HTMLフォーム入力タイプ


password Used to define a single-line text field whose value is obscured, and it will also alert the user if the site is not secure HTMLフォーム入力タイプ



radio Used to define a radio button and select a single value out of multiple. HTMLフォーム入力タイプ


Red
Blue
Green
reset Used to define a button to reset the form values to its defaults. HTMLフォーム入力タイプ


submit Used to define a submit button for the form. HTMLフォーム入力タイプ


text Used to define a text field in the form. HTMLフォーム入力タイプ



List of the types of “input” available in HTML5

Type Description Format Example
color Used to define the color of the elements in an HTML form. It takes a hexadecimal input. HTMLフォーム入力タイプ


datetime-local Used to define an element for date and time in the HTML form with opening a date picker or numeric wheels for the month, day, and year, when used in supported browsers. HTMLフォーム入力タイプ


email Used to define a text field for email which has all the predefined validations done for checking an email. HTMLフォーム入力タイプ


date Used to define a date picker for the HTML form. HTMLフォーム入力タイプ


number Used to input numbers in the HTML form by displaying a spinner and adding default validation when used in supported browsers. HTMLフォーム入力タイプ


range Used to define a range in the HTML form. HTMLフォーム入力タイプ


search Used to define single-line text fields for entering search strings. HTMLフォーム入力タイプ


tel Used to define a telephone entering field within an HTML form. HTMLフォーム入力タイプ


time Used to define a field for entering time in HTML form HTMLフォーム入力タイプ


url Used to define a text field for entering a url in the HTML form with all its validations being performed automatically.

 

HTMLフォーム入力タイプ


week Used to define a text field for entering the week-year number and a week number with no time zone. HTMLフォーム入力タイプ


datetime Used to define a text field for entering a date and time (hour, minute, second, and fraction of a second) based on the UTC time zone. HTMLフォーム入力タイプ


属性

以下のセクションでは、関連するすべての属性を簡単な説明とともにリストした表を提供します。この表の後には、各属性とそれらが関連付けられている入力タイプを詳細に説明するリストが続きます。ほとんどまたはすべての入力タイプに共通するものについては、以下で詳しく定義します。

Attribute Types
1.       accept file
2.       alt image
3.       autocomplete all
4.       autofocus all
5.       capture file
6.       checked radio, checkbox
7.       dirname text, search
8.       disabled all
9.       form all
10.    formaction image, submit
11.    formenctype image, submit
12.    formmethod image, submit
13.    formnovalidate image, submit
14.    formtarget image, submit
15.    height image
16.    list almost all
17.    max numeric types
18.    maxlength password, search, tel, text, url
19.    min numeric types
20.    minlength password, search, tel, text, url
21.    multiple email, file
22.    name all
23.    pattern password, text, tel
24.    placeholder password, search, tel, text, url
25.    readonly almost all
26.    required almost all
27.    size email, password, tel, text
28.    src image
29.    step numeric types
30.    type all
31.    value all
32.    width image

結論 – HTML フォーム入力タイプ

HTML5 の新しいフォーム入力タイプの助けを借りて、ユーザーのエクスペリエンスを向上させ、将来性のあるアプリケーションを作成し、開発者にとってコーディングを少し容易にすることができます。これらの新しいフォーム入力タイプのサポートは、特にキーパッドを備えたモバイル デバイスで強力です。これらの入力タイプはユーザビリティの観点から安全であり、ユーザーに追加のユーティリティも提供します。

以上がHTMLフォーム入力タイプの詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
HTMLの目的:Webブラウザがコンテンツを表示できるようにするHTMLの目的:Webブラウザがコンテンツを表示できるようにするMay 03, 2025 am 12:03 AM

HTMLの中心的な目的は、ブラウザがWebコンテンツを理解して表示できるようにすることです。 1。HTMLは、タグなどのタグを介してWebページの構造とコンテンツを定義します。 3.HTMLは、ユーザーの相互作用をサポートするフォーム要素を提供します。 4. HTMLコードの最適化は、HTTP要求の削減やHTMLの圧縮など、Webページのパフォーマンスを改善できます。

Web開発にとってHTMLタグが重要なのはなぜですか?Web開発にとってHTMLタグが重要なのはなぜですか?May 02, 2025 am 12:03 AM

htmltagsareSterenceforwebdevelovementasyStheStructureanhandhancewebpages.1)theydefineLayout、semantics、and-interactivity.2)semanticagsimprovecessibility.3)opeusofusofagscanoptimizeperformanceandensurecross-brows-compativeation。

HTMLタグと属性に一貫したコーディングスタイルを使用することの重要性を説明します。HTMLタグと属性に一貫したコーディングスタイルを使用することの重要性を説明します。May 01, 2025 am 12:01 AM

コードの読みやすさ、保守性、効率を向上させるため、一貫したHTMLエンコーディングスタイルは重要です。 1)低ケースタグと属性を使用します。2)一貫したインデントを保持し、3)シングルまたはダブルの引用符を選択して固執する、4)プロジェクトのさまざまなスタイルの混合を避け、5)きれいなスタイルやEslintなどの自動化ツールを使用して、スタイルの一貫性を確保します。

ブートストラップ4にマルチプロジェクトカルーセルを実装する方法は?ブートストラップ4にマルチプロジェクトカルーセルを実装する方法は?Apr 30, 2025 pm 03:24 PM

Bootstrap4にマルチプロジェクトカルーセルを実装するソリューションBootstrap4にマルチプロジェクトカルーセルを実装するのは簡単な作業ではありません。ブートストラップですが...

DeepSeekの公式Webサイトは、マウススクロールイベントの浸透の影響をどのように達成していますか?DeepSeekの公式Webサイトは、マウススクロールイベントの浸透の影響をどのように達成していますか?Apr 30, 2025 pm 03:21 PM

マウススクロールイベントの浸透の効果を実現する方法は? Webを閲覧すると、いくつかの特別なインタラクションデザインに遭遇することがよくあります。たとえば、DeepSeekの公式ウェブサイトでは、...

HTMLビデオの再生コントロールスタイルを変更する方法HTMLビデオの再生コントロールスタイルを変更する方法Apr 30, 2025 pm 03:18 PM

HTMLビデオのデフォルトの再生コントロールスタイルは、CSSを介して直接変更することはできません。 1. JavaScriptを使用してカスタムコントロールを作成します。 2。CSSを介してこれらのコントロールを美化します。 3. video.jsやPLYRなどのライブラリを使用すると、互換性、ユーザーエクスペリエンス、パフォーマンスを検討してください。プロセスを簡素化できます。

お使いの携帯電話でネイティブセレクトを使用することにより、どのような問題が発生しますか?お使いの携帯電話でネイティブセレクトを使用することにより、どのような問題が発生しますか?Apr 30, 2025 pm 03:15 PM

携帯電話でネイティブセレクトを使用する際の潜在的な問題は、モバイルアプリケーションを開発するときに、ボックスを選択する必要があることがよくあります。通常、開発者...

お使いの携帯電話でネイティブ選択を使用することの欠点は何ですか?お使いの携帯電話でネイティブ選択を使用することの欠点は何ですか?Apr 30, 2025 pm 03:12 PM

お使いの携帯電話でネイティブ選択を使用することの欠点は何ですか?モバイルデバイスでアプリケーションを開発する場合、適切なUIコンポーネントを選択することが非常に重要です。多くの開発者...

See all articles

ホットAIツール

Undresser.AI Undress

Undresser.AI Undress

リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover

AI Clothes Remover

写真から衣服を削除するオンライン AI ツール。

Undress AI Tool

Undress AI Tool

脱衣画像を無料で

Clothoff.io

Clothoff.io

AI衣類リムーバー

Video Face Swap

Video Face Swap

完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。

ホットツール

SublimeText3 英語版

SublimeText3 英語版

推奨: Win バージョン、コードプロンプトをサポート!

ドリームウィーバー CS6

ドリームウィーバー CS6

ビジュアル Web 開発ツール

SublimeText3 Mac版

SublimeText3 Mac版

神レベルのコード編集ソフト(SublimeText3)

SublimeText3 Linux 新バージョン

SublimeText3 Linux 新バージョン

SublimeText3 Linux 最新バージョン

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

強力な PHP 統合開発環境