Socket
Socket
Sign inDemoInstall

caret-position2

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    caret-position2

Manage caret/selection on input/textarea. Refactored caret-position.


Version published
Weekly downloads
180
decreased by-32.58%
Maintainers
1
Install size
6.29 kB
Created
Weekly downloads
 

Readme

Source

caret-position2

Get and set the user's text selection on an input or text area.

$ npm install caret-position2

var get = require('caret-position2/get');
var set = require('caret-position2/set');

// Set caret position after the first character
set(input, 1)
get(input) // -> { start:1, end:1, caret:1 }

// Set text selection to the second and third character
set(input, 1, 3)
get(input) // -> { start:1, end:3, caret:3 }

NPM

FAQs

Last updated on 13 Mar 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc