问题
Does anyone have a technique that will allow me to determine which element has focus after a blur event? I have an input field which I'd like to reset on blur unless the blur was caused by the user clicking the "save" button. I'd love to just set a flag in the save button's onclick function, but that would fire too late (unless click events always fire before blur events, which I doubt.)
回答1:
Answered here; When onblur occurs, how can I find out which element focus went to?
来源:https://stackoverflow.com/questions/528208/javascript-blur-event-is-there-any-way-to-detect-which-element-now-has-focus