getSelectionRange in mozilla?

J

jen_designs

There is s function in mozilla called setSelectionRange where you set a
start point and an end point for text to be highlighted in an input
box. Is there a getSelection range that can tell me the character
position that a user highlights in mozilla? Say there is a sentence,
dhtml rules, if the users highlights dhtml, then the start point would
be 0 and the end point would be 4. Any thoughts?
 
M

Martin Honnen

There is s function in mozilla called setSelectionRange where you set a
start point and an end point for text to be highlighted in an input
box. Is there a getSelection range that can tell me the character
position that a user highlights in mozilla?

No, but text controls have properties
selectionStart
selectionEnd
that your script can read.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top