HTML | DOM Input Date value Property Last Updated : 24 Nov, 2022 Comments Improve Suggest changes Like Article Like Report The Input Date value property is used for setting or returning the value of the value attribute of a date field. The Input Date value attribute can be used for specifying a date for the date field.Syntax: For returning the value property: inputdateObject.valueFor setting the value property: inputdateObject.value = YYYY-MM-DD Property Value: YYYY-MM-DD :It is used to specify the date. YYYY: It specifies the year.MM: It specifies the month.DD: It specifies the day of the month. Return Value: It returns a string value which specify the value of date for the date field. Below program illustrates the Date value property :Example 1: Setting a date for a datetime field. html <!DOCTYPE html> <html> <head> <title>Input Date value Property in HTML</title> <style> h1 { color: green; } h2 { font-family: Impact; } body { text-align: center; } </style> </head> <body> <h1>GeeksforGeeks</h1> <h2>Input Date value Property</h2> <br> Date Of Birth: <input type="date" id="Test_Date"> <p>To set a date for the date field, double-click the "Set Date" button.</p> <button ondblclick="My_Date()">Set Date</button> <p id="test"></p> <script> function My_Date() { document.getElementById("Test_Date").value = "2019-02-04"; } </script> </body> Output: After clicking the button Example-2: Below code returns a date value property. HTML <!DOCTYPE html> <html> <head> <title>Input Date value Property in HTML</title> <style> h1 { color: green; } h2 { font-family: Impact; } body { text-align: center; } </style> </head> <body> <h1>GeeksforGeeks</h1> <h2>Input Date value Property</h2> <br> Date Of Birth: <input type="date" id="Test_Date" value="2013-12-12"> <p>To return a date for the date field, double-click the "Set Date" button.</p> <button ondblclick="My_Date()">Return Date</button> <p id="test"></p> <script> function My_Date() { var g = document.getElementById("Test_Date").value; document.getElementById('test').innerHTML= g; } </script> </body> Before: After: Supported Web Browsers: Apple Safari 14.1Edge 12Firefox 57Google Chrome 20Opera 11 Comment More infoAdvertise with us Next Article HTML | DOM Input Date value Property S Shubrodeep Banerjee Follow Improve Article Tags : Web Technologies HTML HTML-DOM Similar Reads HTML | DOM Input Datetime value Property The Input Datetime value property is used for setting or returning the value of the value attribute of a datetime field. The Input Datetime value attribute can be used for specifying a date and time for the datetime field. Syntax: For returning the value property:datetimeObject.valueFor setting the 2 min read HTML | DOM Input Date type Property The Input Date type property is used for returning the type of form element the date field is. The Input Date type property returns a string that represents the type of form element the date field is. Syntax: inputdateObject.type Return Values: It returns a string value that represents the type of f 1 min read HTML | DOM Input Date step Property The Input Date Step property is used to set or return the value of the step attribute of a date field. The Input Step attribute can be used for specifying the legal day intervals to choose from when the user opens the calendar in a date field. Syntax: To return the step property: inputdateObject.ste 2 min read HTML | DOM Input DatetimeLocal value Property The Input DatetimeLocal value property is used for setting or returning the value of the value attribute of a datetimeLocal field. The Input DatetimeLocal value attribute can be used for specifying a date and time for the datetimeLocal field. Syntax: For returning the value property:datetimelocalObj 2 min read HTML | DOM Input Date readOnly Property The Input Date readOnly property is used for setting or returning whether a date field should be read-only, or not. Once a field has been declared read-only, it cannot be further modified. However, the read-only field can be tabbed, highlighted and can be used for copying text. The HTML readonly att 2 min read Like