Skip to content

Instantly share code, notes, and snippets.

@jwizard
Last active December 10, 2015 04:48
Show Gist options
  • Save jwizard/4383907 to your computer and use it in GitHub Desktop.
Save jwizard/4383907 to your computer and use it in GitHub Desktop.
// enter key 처리
var stopRKey = function(evt) {
var evt = (evt) ? evt : ((event) ? event : null);
var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
if ((evt.keyCode == 13) && (node.type=="text")) {
$("#akc_kwd").val( $.trim($("#akc_kwd").val()) );
if ($("#akc_kwd").val() == '') {
alert('검색어를 입력해 주세요.');
return false;
}
}
}
document.onkeypress = stopRKey;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment