isFocus

Type:Function
Status:stable
Since:1.0.0
Platform:js
@blackbyte.sugar.js.is

Check if the mouse is focus the passed HTMLElement

Params

  1. $elm*-HTMLElement

    The HTMLElement to check

Return

  1. -Boolean

    true if element is focus, false if not

Example

import { isFocus } from '@blackbyte/sugar/is'
const $myElm = document.querySelector('.my-elm')
if (isFocus($myElm)) {
  // do something
}

Todo

  • testsnormal