I’m looking for a cross-browser method – I know IE has something (I’ve already forgotten what), and the way to do it in Mozilla may have to do with a focusNode thing I found, that seems related to getting text selections.
Methods involving jQuery or another common JS library are fine by me.
Thanks!
Check out the extra selectors plugin for jQuery, it includes a
:focusselector that answers your need. You can use just the implementation of that selector if you don’t the rest.