eggasil.blogg.se

Text caret
Text caret






Replace the currently selected text of the first matched element with the given text and select the newly inserted text. Select the 8th-last character up to (but NOT including) the 3rd-last character Select everything 5 characters from the end and later Select everything after the 3rd character through (and including) the 8th character Zero-based index relative to the beginning of the input's value.ĮndPos Number (optional): New selection end position.Įxamples: // Select everything after the 6th character StartPos Number: New selection start position. Set the selection range of the first matched element. caret().range(startPos ) returns jQuery object If no text is selected, the start and end position will be equal to the cursor position returned by. Get the selected range (start and end position) of the first matched element, along with the value of the selected text and its length. Interrogate and manipulate the selected range of an input field.range() returns Range text String: Text to insert at the current cursor position.Įxamples: // Insert some text at the current cursor position.Insert text at the current cursor position of the first matched element and place the cursor after the inserted text. Place cursor before the 3rd-last character Negative numbers are relative to the end of the input's value.Įxamples: // Place cursor after the 3rd character Zero-based index relative to the beginning of the input's value. Set the cursor position of the first matched element. If one or more characters are selected, the start position of the selected range is returned.caret(pos) returns jQuery object Get the cursor position of the first matched element. Interrogate and manipulate the cursor position of an input field at a single point without selecting any text.caret() returns Number Select/deselect all text within any element.Handles differences in line endings between browsers.Get/set cursor position and selected range.

text caret

Of and elements, as well as highlight text on the page. Cross-browser jQuery plugin that allows you to manipulate the cursor position and selection range








Text caret