<style>
#XY{
width:40px;
height:100px;
background:#aaa;
}
</style>
<input type="input" />
<script>
$(document).ready(function() {
$("input").keyup(function(e){
if(e.which=="13"){
alert("回车提交!")
}
})
});
</script>
原文:http://www.cnblogs.com/weixin186/p/5046196.html