Skip to content

dandv/caret-1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

Caret

Caret is a small jQuery plugin that gets and sets the caret position for an HTML element.

Caret may be used as follows:

// get the caret position
var caretPosition = $("textarea").caret();

// set the caret position
$("textarea").caret(newPosition);

Caret follows the jQuery convention of returning the this object for the setter so calls can be chained:

// move the caret and set the color to blue
$("textarea").caret(newPosition).css("color: blue;");

Caret has been tested in Chrome, Firefox, Safari and Internet Explorer 8 and 9.

About

A jQuery plugin for getting and setting the caret position

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 91.3%
  • CSS 8.7%