Click here to Skip to main content
15,867,771 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,
I have a childNode in an element (which is a content editable div). It contains span element as "[ ]". I want to set my cursor in between the square brackets. If I put index as 0, the cursor is set before [. If I put index as 1, the cursor is set after ].
Can anyone tell me how to make the cursor set in between the two brackets?
Thanks in advance.
Posted
Updated 13-May-15 2:44am
v2
Comments
Sergey Alexandrovich Kryukov 13-May-15 11:21am    
Do you mean the caret in text (selection)?
—SA
Bhavika Mdm 14-May-15 0:30am    
Yes. There is a content editable div, which has got some text and some span elements in it. I am able to get my caret position every where in the text, except for the middle position of a square bracket, which is a span element like, "<span>[ ]</span>".

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900