使用DOM来分配事件
document.getElementById("p1").onclick = function(){displayDate()};
常用事件:
HTML DOM事件:https://www.runoob.com/jsref/dom-obj-event.html