HTML DOM Input Date value Property

The HTML DOM Input Date value property returns a string, which is the value of the value attribute of input date. User can also set it to a new string.


Following is the syntax −

  • Returning string value
  • Setting value attribute to a string value
inputDateObject.value = ‘String’


Let us see an example of Input Date value property −

 Live Demo

<!DOCTYPE html>
<title>Input Date Value</title>
Calendar: <input type="date" id="dateSelect" value="2015-08-22">
<button onclick="changeValue()">Change Value</button>
<div id="divDisplay"></div>
   var divDisplay = document.getElementById("divDisplay");
   var inputDate = document.getElementById("dateSelect");
   divDisplay.textContent = 'Current value: '+ inputDate.value;
   function changeValue(){
      var currDate = inputDate.value;
      inputDate.value = '1968-02-27';
      divDisplay.textContent = 'Updated value from: '+currDate+' to: '+ inputDate.value;


This will produce the following output −

Before clicking ‘Change Value’ button −

After clicking ‘Change Value’ button −