find focusable element in a control visual child or logical
I want to find is any focusable element present in a control's visual or logical childerens? Is it possible to find with our any loop itetrartion? or build in methods?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Mike StevePosted Nov 25, 2014, 1:13 AM
Sibeesh VenuPosted Nov 25, 2014, 1:02 AM
// Get the focused element:
var $focused = $(':focus');
// No jQuery:
var focused = document.activeElement;
// Does the element have focus:
var hasFocus = $('foo').is(':focus');
// No jQuery: elem === elem.ownerDocument.activeElement;
http://stackoverflow.com/questions/11277989/how-to-get-the-focused-element-with-jquery