var f_onkeyup_on_input_find_text = function(e){ var key_id; e=e||window.event; key_id = e.keyCode || e.charCode || e.which; alert(key_id); if (key_id==13){//key code 'enter' equally 13 f_add_event_text_find(); } };