cross-browser insert an html string at the cursor position, or over the selected text.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore
History.md
Makefile
Readme.md
component.json
example.html
index.js

Readme.md

insert-at-cursor

insert an html string at the cursor position, or over the selected text. Credits: Tim Down.

Installation

Install with component(1):

$ component install bmcmahen/insert-at-cursor

Example

var insert = require('insert-at-cursor');
document.getElementById('insert').onclick = function(e){
  insert('<b>hello</b>', {selectContent: true});
};

License

MIT