How to know where the input/element goes to after the blur event? [duplicate]
I tr开发者_如何学Pythonied this, but it is undefined:
alert($(ev.relatedTarget).attr('name'));
I have a combobox (textbox and a button), I don't want the code to continue processing if the input goes to its partner control(button). I want to detect from textbox blur that it is leaving the whole combobox not just the textbox. Textbox's blur will naturally trigger when I click its partner button. The only ideal logic I can think of is to detect from textbox's blur that the focus destination is not its partner button, if the relatedTarget is its partner button don't continue processing.
If I understand your question correctly, I'd suggest adding a delayed function on the blur event of the textbox to check if the button is focused or not
精彩评论