How to select an element that has focus on it with jQuery

$(document.activeElement) will return the currently focused element and is faster than using the pseudo selector :focus.

Source: http://api.jquery.com/focus-selector/

Leave a Comment