검색 페이지 작성시 엔터키로 submit 하는 방식입니다.
엔터의 key 코드는 13이기 때문에 key 코드 13인지 확인해서 submit 하면 됩니다.
<!doctype html>
<html lang="kr">
<head>
<meta charset="utf-8">
<title>demo</title>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script>
$('form input').keydown(function(e) {
if (e.keyCode == 13) {
$('form').submit();
}
});
</script>
</head>
<body>
<form action="#">
<input type="text" id="searchWord"/>
</form>
</body>
</html>