select

jQuery.caph.focus.controllerProvider.controller. select

Selects the given item if it is equal to the current focus item. If the given item is not equal to the current focus item, changes the current focus item to the given item. If not passed anything else, selects the current focus item. But if there is no current focus item, searches for the previously focused item or initial focus item and then focuses it.

(static) select(itemopt, originalEventopt) → {jQuery.caph.focus.controllerProvider.controller}

Parameters:
Name Type Attributes Description
item DOMElement | string <optional>

A DOM element to be selected. If the string value is passed, it represents the name of the focusable. If not passed anything else, selects the current focus item.

originalEvent Event <optional>

The original event. If you want to know about the original event in the handler function, pass it to second parameter.

Returns:
Type
jQuery.caph.focus.controllerProvider.controller
Example
function selectCurrentFocusItem() {
 	$.caph.focus.controllerProvider.getInstance().select();
 }