< html > < head >< title ></ title > < script > function window_onkeypress() { alert(window.event.button); if(window.event.keyCode == 27) { window.close(); } } </ script > < body onMouseDown = " window_onkeypress() " > </ body > </ head > < body onMouseDown = " window_onkeypress() " > </ body > </ html > 转载于:https://www.cnblogs.com/pageantry/archive/2007/01/08/615068.html