jQuery('#wpSummary').on('keyup keypress', function(e) { var keyCode = e.keyCode || e.which; if (keyCode === jQuery.ui.keyCode.ENTER) { e.preventDefault(); return false; } });