<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
div{
width: 100px;
height:100px;
}
</style>
<style>
</style>
</head>
<body>
<input type="text"placeholder="请输入">
<div></div>
<script>
var oInput=document.getElementsByTagName("input")[0];
var oDiv=document.getElementsByTagName("div")[0];
document.οnkeydοwn=function(ev){
var oEvent=ev||window.event;
if(oEvent.ctrlKey&&oEvent.keyCode==13){
oDiv.innerHTML+=oInput.value+"<br>";
oInput.value="";
}
}
</script>
</body>
</html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
div{
width: 100px;
height:100px;
}
</style>
<style>
</style>
</head>
<body>
<input type="text"placeholder="请输入">
<div></div>
<script>
var oInput=document.getElementsByTagName("input")[0];
var oDiv=document.getElementsByTagName("div")[0];
document.οnkeydοwn=function(ev){
var oEvent=ev||window.event;
if(oEvent.ctrlKey&&oEvent.keyCode==13){
oDiv.innerHTML+=oInput.value+"<br>";
oInput.value="";
}
}
</script>
</body>
</html>