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
162
decreased by-35.46%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

caret-position Code Climate License

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

See test.html for example usage.

API

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

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

NPM

FAQs

Last updated on 06 May 2015

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