Getting the coordinates of a piece of text with Javascript?
- From: "sasperilla" <charlie.hubbard@xxxxxxxxx>
- Date: 22 Feb 2006 08:45:20 -0800
Hi,
I would like to find the coordinates of a word inside a div or span
tag. I know you can find the coordinates of a tag inside the DOM, but
can you get the coordinates of a portion of the text inside that
element in javascript?
If the user highlights or selects text in a div or span can I get the
indicies that make up that selected piece of text? What API of
javascript do I use to find that out? Or really is there a way in
javascript to interact with the browsers text selection?
Thanks
Charlie
.
- Follow-Ups:
- Re: Getting the coordinates of a piece of text with Javascript?
- From: Martin Honnen
- Re: Getting the coordinates of a piece of text with Javascript?
- Prev by Date: Re: javascript failing in Safari
- Next by Date: Accesing an IFrame from an internal element
- Previous by thread: masking
- Next by thread: Re: Getting the coordinates of a piece of text with Javascript?
- Index(es):