I would like for a text box to disappear if a person clicks out side of it (.focusout or .blur) but I also want to be able do the same function if Esc is pressed (key 27). I am not sure how to get both to be recognized without ruining my entire script.
Share
You can bind both events to the same function with
And then it’s just decision logic to see if it was a key that was pressed or whatnot.