WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 set caret position in contentEditable div, adam, May 3, 2004
     Re:set caret position in contentEditable div, Brian R. James, May 7, 2004
         Re:set caret position in contentEditable div, ?, September 16, 2004

Subject: Re:set caret position in contentEditable div From: Brian R. James Date: May 7, 2004

Adam, use a text range to set the caret position in an IE contentEditable div.  The following code will search for the word space in the DIV and move the caret position.

var oRange = document.selection.createRange();
oRange.findText('space');
oRange.collapse();
oRange.select();

From: adam
Sent: May 3, 2004
Subject: Re:set caret position in contentEditable div

Is there any way of setting (or getting) the caret position in an IE contentEditable div?

calling .focus() always puts it at the start.

 

Adam





Reply
Name: 
Email: 
Subject: 

Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.


View All Messages
Back to WebFX