Skip to content

Latest commit

 

History

History
31 lines (28 loc) · 980 Bytes

README.md

File metadata and controls

31 lines (28 loc) · 980 Bytes

libcursor

Build Status Code Climate Test Coverage

libcursor is a JavaScript library for manipulating cursor inside textareas and contenteditable html elements.

Using libcursor (Full API docs)

Include the library:
<script 
   type='text/javascript' 
   src='//sujeet.github.io/libcursor/libcursor.js'>
</script>
Here is a sample piece of code:
/**
 * Write "Hello world!" with cursor 
 * ending up just after the 'o' in 'Hello' 
 */
Cursor
  .current()
  .insert("world!")
  .moveBackward(6)
  .insert("Hello")
  .insertAfter(" ");