I am trying to bind a blur and keyup event handler to a textbox; I only want the logic to execute on all blur events and in the event of the keyup, only upon the user hitting Enter/ return (code 13). This should be simple if I can tell which of the events were captured, but I can’t seem to find something that describes what I need to look for. Quick few points for a simple answer.
Share
You can use the jQuery event object to get info about the event.
event.typewill tell you which event was triggered.You can also just check
event.whichwhich will beundefinedwhen it’s ablurevent.