一.添加事件的方法 1.EventTarget.addEventListener添加 获取事件目标元素,通过addEventListener函数添加 // Assuming myButton is a button element myButton.addEventListener('click', greet, false); function greet(event){ // print and have a look at the event object // always print…