find-focused-element package is available
22 Apr 2020It’s a short post about a new npm package I’ve just uploaded.
TL;DR
Why
While developing a chrome extension I needed an easy way to access a currently focused element.
Quick Start
Add it to your project:
npm install --save find-focused-element
Import using ES Modules:
import findFocusedElem from 'find-focused-element';
Or as a CommonJS:
const findFocusedElem = require('find-focused-element');
Use:
const elem = findFocusedElem(window.document);
Browser Support
The library has been tested in:
- Latest Edge, Firefox, Chrome, Opera, Safari (Mac)
- iOS 11 Safari
- IE 8-11
Follow me online
Join the Discord: https://discord.gg/V4yMGPQzRB
- GitHub: https://github.com/FSou1
- LinkedIn: https://www.linkedin.com/in/maxim-zhukov-dev
- Youtube: https://www.youtube.com/channel/UCz6AZvABoICHPpi43y-Hd5g
- Telegram: https://t.me/seasoneddev