Get started with caret CDN

BSD-3-Clause licensed

Caret.js: Lightweight, flexible DOM text node manipulation/traversal library.

Tags:
  • caret

Stable version

Copied!

How to start using caret CDN


$(document).ready(function() {
  $('textarea#myTextarea').caret();

  $('button#addText').click(function() {
    $('textarea#myTextarea').val($('textarea#myTextarea').val() + ' New text');
    $('textarea#myTextarea').caret('move-end');
  });
});
Copied!
Copied!
Copied!

All versions