use keydown.
keypress doesn't work with ESC in Chrome (not sure about other browsers).
$(newTag).keydown(function(e) { //keypress did not work with ESC;
if (event.which == '13') {
ProfilePage.saveNewTag(search_id, $(newTag).val());
}
else if (window.event.which){
$(newTag).remove();
}
});