document.onclick = f1;
document.onmouseover = f1;
document.onmouseout = f1;
function f1(e) {
switch (e.type) {
case "click": alert("你好啊!");
break;
case "mouseover": this.style.backgroundColor = "red";
break;
case "mouseoiut": this.style.backgroundColor = "green";
break;
default:
break;
}
}