[whatwg] Standard method to get/set caret position

Greg Kilwein gkilwein at fbsdata.com
Sun Aug 29 14:52:18 PDT 2004


On Sun, 29 Aug 2004, Jim Ley wrote:
> On Sun, 29 Aug 2004 15:59:19 -0500 (CDT), Greg Kilwein
> <gkilwein at fbsdata.com> wrote:
> > Given a text box or textarea that I'll refer to as "tx":
> > 
> > tx.selectionStart: This is a read/write integer that would set or retrieve
> >   the starting index of the selected text (one-based, so "1" would be
> >   the first character in the string).  If nothing is selected, 0 would
> >   be returned.
> 
> What do you do with characters such as a ZWJ, does it count in the
> length, what happens if you set the caret to its position etc.

How do existing UAs (or even native applications) handle this character in
text boxes?  If there is common precedent, then following it would be
advantageous.

Greg





More information about the whatwg mailing list