input要素を使いこなそう【日付編】

Contents

input要素とは

input要素については過去記事で解説しているので、下記の記事リンクからお読みください。

[blogcard url=”https://chillblog.org/2022/06/10/input%e8%a6%81%e7%b4%a0%e3%82%92%e4%bd%bf%e3%81%84%e3%81%93%e3%81%aa%e3%81%9d%e3%81%86%e3%80%90%e3%83%86%e3%82%ad%e3%82%b9%e3%83%88%e5%81%8f%e3%80%91/”]

日付入力系のinput

input type = ”date”

dateでは年月日をカレンダーから簡単に選択できるようなフィールドを表示します。

<input type = "date">

input type = ”datetime-local”

date-localは年月日だけでなく時間帯も入力することができます。

<input type = "datetime-local">

input type = ”month”

monthは「年と月」を選択させたい場合に使用します。

<input type = "month">

input type = ”week”

weekは年と週を選択したい場合に使用します。

<input type = "week">

input type = ”time”

timeを指定することで時間と分だけの入力フォームを表示します。

<input type = "time">

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

CAPTCHA