键盘事件
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script>
window.onload = function(){
var text1 = document.getElementById('text1');
var textarea1 = document.getElementById('textarea1');
text1.onkeydown = function(ev){
//获取事件
var oevent = ev || event;
//获取发生时间的键盘码,oevent.ctrlKey取得ctrl权限,类似的还有shiftKey等
if(oevent.keyCode == 13 && oevent.ctrlKey){
textarea1.value = text1.value;
text1.value = '';
}
}
}
</script>
</head>
<body>
<input type="text" id="text1"/><br />
<textarea id="textarea1"></textarea>
</body>
</html>