isFocusWithin

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

Check if the mouse is isFocusWithin the passed HTMLElement

Params

  1. $elm*-HTMLElement

    The HTMLElement to check

Return

  1. -Boolean

    true if element is focus within, false if not

Example

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

Todo

  • testsnormal