<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<script src="../js/jquery-1.10.2.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#dataInput').bind('keypress', function (event) {
if (event.keyCode == "13") {
alert('你输入的内容为:' + $('#dataInput').val());
}
});
});
function dia()
{
if (event.keyCode == 13) {
alert('你输入的内容为:' + $('#dialog').val());
}
}
</script>
</head>
<body>
<input id="dataInput" type="text" />
<input id="dialog" type="text" onkeypress="dia()" />
</body>
</html>