请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
<!DOCTYPE html>
<html>
<head>
<title>回车发表评论</title>
<script src="https://www.jq22.com/jquery/jquery-3.3.1.js"></script>
<style>
#input_one{
width: 100px;
height: 50px;
}
#input_two{
width: 300px;
height: 300px;
}
</style>
</head>
<body>
<input type="text" id="input_one">
<input type="text" id="input_two">
<script>
var input_one=document.getElementsByTagName("input")[0];
var input_two=document.querySelector("#input_two");
$(document).on("keyup",function(e){
var m_e = e || window.event;
var keycode = m_e.which;
if(keycode === 13){
input_two.value=input_one.value;
input_one.value=null;
}
});
</script>
</body>
</html>