Beshoy Maurice
Beshoy Maurice

Reputation: 3

Input type month default value

How to set the default Value of input type month using only HTML??

I tried to set the value like this <input type="month" value="oct-1982"> and also like this <input type="month" value="1982-oct"> but nothing happened

Upvotes: 0

Views: 521

Answers (2)

pbs
pbs

Reputation: 148

Try this:

<input id="month" type="month" value="1982-10">

But you should take a look at this answer https://stackoverflow.com/a/53188466/12102286

Upvotes: 1

splrs
splrs

Reputation: 2432

The format of value is YYYY-MM (both numerical), so use:

<input type="month" value="1982-10">

Upvotes: 0

Related Questions