Input Month defaultValue attribute

Definition and usage

defaultValue Set or return the default value of the month field. The defaultValue property

Note:The default value is HTML value attribute specified in.

The difference between defaultValue and value properties is that defaultValue contains the default value, while value contains the current value after some changes. If there is no change, defaultValue and value are the same (see "More Examples").

If you want to check if the month/year of the month field has changed, the defaultValue property is very useful.

Instance

Example 1

Change the default value of the month field:

document.getElementById("myMonth").defaultValue = "2023-06";

Try it yourself

Example 2

Get the default value of the month field:

var x = document.getElementById("myMonth").defaultValue;

Try it yourself

Example 3

An example showing the difference between defaultValue and value properties:

var x = document.getElementById("myMonth");
var defaultVal = x.defaultValue;
var currentVal = x.value;

Try it yourself

Syntax

Return defaultValue property:

monthObject.defaultValue

set defaultValue property:

monthObject.defaultValue = value

বৈশিষ্ট্যমান

মান বর্ণনা
value মাস ক্ষেত্রের ডিফল্ট মান নির্ধারণ

কারিগরি বিবরণ

ফলাফল: শব্দমালা মানা, মাস ক্ষেত্রের ডিফল্ট মান

ব্রাউজার সমর্থন

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
সমর্থন 10.0 সমর্থন সমর্থন সমর্থন

প্রতিবেদন:<input type="month"> উপাদান Firefox-এ কোনো তারিখ ক্ষেত্র/ক্যালেন্ডার দেখায় না。