Take control over the text cursor!
The following is a reference which lists the functions belonging to the Turboid text cursor management. In order to use the extra functions, simply download the free Turboid framework and put it into the directory of your HTML file, then write this line into the head section of your HTML file, and that's it:
Cursor.paste(str1 [,str2] )
Pastes a string at the current text cursor position. The argument 'str2' is optional, that means Cursor.paste(str) is sufficient. It is for the case if a whole part of the text is marked, then it pastes 'str1' at the beginning of the selection mark and 'str2' at the end of it.
Gets the current text cursor position. All arguments are optional, that means Cursor.getPos() is sufficient. If the text cursor is a whole selection mark it is recommended to use Cursor.getPos("start") and Cursor.getPos("end") to get the beginning and the end of the selection mark. It works also with Cursor.getPos(0) and Cursor.getPos(1). - Attention: This function is for input fields and text areas only. If no such element is currently focussed, the function returns 'null'.
Sets the text cursor at the desired position. The second argument is optional, that means Cursor.to(pos) is sufficient. If the second argument is set, this function causes a marking effect. - Attention: This function is for input fields and text areas only. If no such element is currently focussed, the function returns 'null'.
Sets the text cursor to the end.
Removes text selection marks, no matter if the selected text is in an input field or a text area element or elsewhere in the document.
Saves the current text selection mark (not the text). - Attention: This is not for input fields or text area elements, but only the other parts of the document.
Restores a text selection mark saved with Cursor.save() if it became lost through a click elsewhere in the document. - Attention: This is not for input fields or text area elements, but only the other parts of the document.