View on GitHub

jQuery.selection

selection text/caret operation - jQuery pulgin

Download this project as a .zip file Download this project as a tar.gz file

日本語版

What is this?

jQuery.selection is a jQuery plugin that operate selection text/caret.

You can get selection text/caret position information or get selected text, replace/insert selected text.

How to use?

jQuery.selection plugin uses the jQuery, only.

Include these two javascript files in your header as follows.

API

API Documentation

Demo

Input form selection operations

Demo 1

Get selected text from the text field


Demo 2

insert/replace selected text.

$.selection()

Get selected text/html.

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts.
Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia.

It is a paradisematic country, in which roasted parts of sentences fly into your mouth. Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text by the name of Lorem Ipsum decided to leave for the far World of Grammar.
The Big Oxmox advised her not to do so, because there were thousands of bad Commas, wild Question Marks and devious Semikoli, but the Little Blind Text didn’t listen.
She packed her seven versalia, put her initial into the belt and made herself on the way.

When she reached the first hills of the Italic Mountains, she had a last view back on the skyline of her hometown Bookmarksgrove, the headline of Alphabet Village and the subline of her own road, the Line Lane.
Pityful a rethoric question ran over her cheek, then

Result value / 取得結果

License / Contact

The MIT License

Copyright © 2010-2012 Koji Iwasaki (@madapaja).