Skip to content
This repository has been archived by the owner on Jan 15, 2022. It is now read-only.

Get and set the user's caret/selection on input/textarea elements

License

Notifications You must be signed in to change notification settings

kudago/Caret-position

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Get and set the user's caret/selection on input/textarea elements

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 70.2%
  • HTML 29.8%