HTML5 <input type=“date”> - onChange Event

Piotr Białek picture Piotr Białek · Nov 23, 2016 · Viewed 79.1k times · Source

Is possible to detect in event onChange for <input type=“date”>, when user using graphical calendar and arrows or using keybord number?

I am only interested in VanillaJS solutions.

Answer

Theodore K. picture Theodore K. · Nov 23, 2016

Something like this?

function handler(e){
  alert(e.target.value);
}
<input type="date" id="dt" onchange="handler(event);"/>