event的altKey,ctrlKey,shiftKey属性 的说明如下(三者差不多,以altKey为例) 说明里明确指出"The property is read-only with no default value."是只读属性 应该不可以实现楼主所要求的功能。SyntaxHTML N/A Scripting [ bAltKeyDown= ] event.altKey Possible ValuesbAltKeyDown Boolean that specifies one of the following values: false ALT key is not pressed. true ALT key is pressed. The property is read-only with no default value.
代码如下:
document.keypress=mykeydown;
function mykeydown()
{
try
{
if(event.keyCode==13)
{
event.keyCode = even.keyCode&&event.shiftKey;
}
}
catch(e)
{
}
}
的说明如下(三者差不多,以altKey为例)
说明里明确指出"The property is read-only with no default value."是只读属性
应该不可以实现楼主所要求的功能。SyntaxHTML N/A
Scripting [ bAltKeyDown= ] event.altKey Possible ValuesbAltKeyDown Boolean that specifies one of the following values: false ALT key is not pressed.
true ALT key is pressed.
The property is read-only with no default value.