Handling caret is an important task in providing a user friendly interface for input text interactively. We can use caret to select text inside a text area to change the default format. Programmer may want to use the caret highlight part of the content inside a text box to notify the end user for something goes wrong.
In order to design the jQuery Caret Plugin, I wrote down the following specifications:
- The jQuery Caret (jCaret) Plugin should be able to detect the caret position, i.e. the position of selected text in a "text input box" (input type="text") or "text area" (textarea)
- The jQuery Caret (jCaret) Plugin should be able to detect the content of selected text in a "text input box" (input type="text") or "text area" (textarea)
- The jQuery Caret (jCaret) Plugin should be able to highlight text by specifying starting position, ending position or length of selection in a "text input box" (input type="text") or "text area" (textarea)
- The jQuery Caret (jCaret) Plugin should be able to highlight text by a search string in a "text input box" (input type="text") or "text area" (textarea)
- The jQuery Caret (jCaret) Plugin should be able to highlight text by using regular expression to specify the format of the text in a "text input box" (input type="text") or "text area" (textarea)
- The input parameter should support Javascript Object.
- The output can be represent as a Javascript Object.
A list of online examples can be found in jQuery Caret plugin page in http://examplet.buss.hk.
Happy Programming
Cloudgen
0 意見:
張貼意見