Cursor position in the text area

I found this script and edited it. On current pressing of any key, a div appears to the left of the text area (gray colored div) at the caret position where the text is written.

I want the div to appear on Keypress of Enter next to the caret position every time ( get the caret position and show div next to it on enter press )

, and if any other key disappears, the div.

I am a bit confused about how the keypress is being used here in this code.

here: http://jsfiddle.net/eMwKd/30/

+3
javascript caret textarea


source to share


No one has answered this question yet

Check out similar questions:

477
Set textarea value in jQuery
172
How do I get the position of the caret column (not pixels) in a textbox, in characters, from the start?
135
Set cursor position to contentEditable <div>
eleven
Is the caret the first line of the text area? On the last line?
7
Show caret in custom text box without displaying its text
five
Mimicng caret in a text box
3
Undo TAB in textarea
2
keep track of the div position in the textbox
1
Set the caret position of the textarea using the x and y position



All Articles
Loading...
X
Show
Funny
Dev
Pics