@f/focus-element

Set the focus on a particular DOM element

Stats

StarsIssuesVersionUpdatedCreatedSize
@f/focus-element
001.0.06 years ago6 years agoMinified + gzip package size for @f/focus-element in KB

Readme

focus-element

Build status Git tag NPM version Code style

Set the focus on a particular DOM element

Installation

$ npm install @f/focus-element

Usage

var focus = require('@f/focus-element')

function onClick (node) {
  focus(node.querySelector('input'))
}

API

focusElement(node)

  • node - The DOM node you want to focus

Returns: void

License

MIT

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.