HTML5< input type =“date”> - onChange事件

问题描述:

可以在事件 onChange 中检测< input type =date> ,当用户时使用图形日历和箭头或使用键盘号

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

我只对VanillaJS中的解决方案感兴趣。

I am only interested solutions in VanillaJS.

这样的事情?

function handler(e){
  alert(e.target.value);
}

<input type="date" id="dt" onchange="handler(event);"/>