如题,为什么把keydown换成click又能有输出呢? function addEnterEvent(element, listener) { addEvent(element, "keydown", function(event){ //我把keydown换成click可以,可是keydown,keyup触发不了? var event = event ? event : window.event; console.log(event.type) console.log(event.keyCode) if (event.keyCode == 13) { //enter健 console.log("22"); clicklistener(); //一个处理函数而已,跟click还是enter没关系 } }); } addEnterEvent($("#doma"), clicklistener()); //$("#doma")自己的封装,获取id为doma的div
OlderSkee
orionwei
newsudhc3634140
OlderSkee