getInitial

jQuery.caph.focus.nearestFocusableFinderProvider.nearestFocusableFinder. getInitial

Gets the initial focusable DOM element.

(static) getInitial(depthopt, groupopt) → {DOMElement}

Parameters:
Name Type Attributes Description
depth number <optional>

The focusable depth to search for. Default value is jQuery.caph.focus.Constant.DEFAULT.DEPTH.

group string <optional>

The focusable group to search for. Default value is jQuery.caph.focus.Constant.DEFAULT.GROUP.

Returns:

If there is no initial element, returns null.

Type
DOMElement
Example
function initializeFocus() {
 	var controller = $.caph.focus.controllerProvider.getInstance();
 	var nearestFocusableFinder = $.caph.focus.nearestFocusableFinderProvider.getInstance();
 
 	controller.focus(nearestFocusableFinder.getInitial());
 }