[jQuery] JQuery selector to detect focus
Hi there, I have a page in which I need to detect which element has the
focus.
The JQuery documentation states that the
http://jquery.com/docs/Base/Expression/CSS/ :focus selector is not
supported, so this would not be possible:
$("DIV INPUT:focus")
It is easy enough to add a selector definition like this `focus:
"a==document.activeElement" ` to the JQuery code (just below "// Form
elements" where :enabled and :checked etc are defined). It works fine in IE
but apparently in other browsers we have to add code to track the focus as
it changes.
So, two questions:
(a) How can we we bolt extra selector definitions to the JQuery library
without modifying the JQuery.js file itself.
(b) In browsers other than IE, is there a simple way in to return the
element that has the focus?
--
View this message in context: http://www.nabble.com/JQuery-selector-to-detect-focus-tf2311127.html#a6425657
Sent from the JQuery mailing list archive at Nabble.com.
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/