[Javascript] Javascript Question

Matt Bushman mbushman at RPU.ORG
Wed Sep 25 15:53:34 CDT 2002


Did you ever figure out how to get the cursor position in a textarea
field????

Let me know...

Your message below:

Dan- I just tried it and it actually gives the position of the mouse and not
the blinking text cursor (sorry I didn't make that clear).

 David > -----Original Message----- > From: Dan Costea [mailto:HYPERLINK
"mailto:costea.dan at ssi-schaefer.ro"costea.dan at ssi-schaefer.ro
<mailto:HYPERLINK > ] > Sent: Tuesday, January 29, 2002 10:28 PM > To:
javascript at LaTech.edu <mailto:javascript at LaTech.edu>  > Subject: Re:
[Javascript] Get the position of the cursor in a > textarea? > > > Yes, it
is possible. I didn't made the code for NS, but with > IE4+ you can > run
the following code: > > <body onMouseMove="document.all['asdf'].innerHTML =
'xPos: ' > + event.x + > '<br>yPos: ' + event.y "> > <div id="asdf"></div> >
<br> > <textarea rows=4 cols=35>this is a textarea ... </textarea> > </body>
> > > > > > > Hi all. Is it possible to get the position of the cursor > in
a textarea? > > E.g. let's say I have: > > > > Hello there, Welcome to 12345
company. > > > > in a textarea, and the cursor is currently after the word >
Hello. So I > would > > like a value of 6 returned by such a javascript
function. Thanks! > > > > David 


Matt Bushman, IT Analyst
Rochester Public Utilities
4000 East River Road NE
Rochester, MN 55906
Phone: 507-280-1536
Email: msbushman at rpu.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20020925/e5a89d06/attachment.htm>


More information about the Javascript mailing list