<
html
>
< script language = " javascript " >
function test()
{
if (event.keyCode == 13 )
{
alert( " 你按了回车 " )
}
if (event.shiftKey == true )
{
alert( " 你按了shift " )
}
if (event.ctrlKey == true )
{
alert( " 你按了ctrl " )
}
if (event.altKey == true )
{
alert( " 你按了alt " )
}
}
< / script>
< body onkeydown = " test() " >
Please type " enter " key " shift " key " ctrl " key " alt " key.
< / body >
< / html>
< script language = " javascript " >
function test()
{
if (event.keyCode == 13 )
{
alert( " 你按了回车 " )
}
if (event.shiftKey == true )
{
alert( " 你按了shift " )
}
if (event.ctrlKey == true )
{
alert( " 你按了ctrl " )
}
if (event.altKey == true )
{
alert( " 你按了alt " )
}
}
< / script>
< body onkeydown = " test() " >
Please type " enter " key " shift " key " ctrl " key " alt " key.
< / body >
< / html>