html代码:
<textarea onkeypress="capture(event,this)"></textarea>
js代码:
function capture(event,o)
{
var keynum;
if(window.event)
{
keynum=event.keyCode;
}
else
{
keynum=event.which;
}
event = event || window.event;
if(event.ctrlKey&&(keynum==13||keynum==10))
{
alert('ctrl+enter事件');
}
}