Input Week defaultValue attribute

Definition and usage

defaultValue The attribute sets or returns the default value of the week field.

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

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 the example below).

If you want to check if the week in the week field has changed, the defaultValue property is very useful.

Instance

Example 1

Change the default value of the week field:

document.getElementById("myWeek").defaultValue = "2023-W01";

Try it yourself

Example 2

Get the default value of the week field:

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

Try it yourself

Example 3

Show an example of the difference between defaultValue and value properties:

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

Try it yourself

Syntax

Return defaultValue property:

weekObject.defaultValue

set defaultValue property:

weekObject.defaultValue = value

প্রতিমাণ

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

প্রযুক্তিগত বিবরণ

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

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

চ্রোম এডজ ফায়ারফক্স স্যাফারি অপেরা
চ্রোম এডজ ফায়ারফক্স স্যাফারি অপেরা
সমর্থন 10.0 সমর্থন সমর্থন সমর্থন

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