要想在你的网页上加上一个快捷键,那就试试吧
<!-- 要实现此效果需要 2 个步骤: -->
<!-- 第 1 步: -->
<!-- 把下面的代码加到<HEAD></HEAD>区域中: -->
<script language="Javascript">
<!--
var hotkey=97
var destination="http://www.webasp.net"
if (document.layers)
document.captureEvents(Event.KEYPRESS)
function backhome(e){
if (document.layers){
if (e.which==hotkey)
window.location=destination
}
else if (document.all){
if (event.keyCode==hotkey)
window.location=destination
}
}
document.onkeypress=backhome
//-->
</script>
<!-- 第 2 步: -->
<!-- 把下面的代码加到<BODY></BODY>区域中: -->
按一个键盘“A”,页面将转到首页。