htmlcssnewbie
09-22-2008, 09:13 AM
Say I have an input textbox. When I highlight said textbox with my mouse, it will trigger an onselect event. Now, what this onselect event should do is copy the text that was highlighted to the clipboard. Better yet, becasue copying to the clipboard works only in iE, iirc, copy the text to a global javascrpt variable. Either way, I need to understand how one would know how much of the text the user highlighted.
Edit: I have figured out how to select the text I want and copy or delete it as I wish. Now what I wish to do is figure out the caret position. I read one article that said, for non-gecko-based browsers (read: IE), you can insert a delimiter and use that to find the caret but it seems overly complex and unnecessary. There must be a simpler way, one would think.
Thank you.
Edit: I have figured out how to select the text I want and copy or delete it as I wish. Now what I wish to do is figure out the caret position. I read one article that said, for non-gecko-based browsers (read: IE), you can insert a delimiter and use that to find the caret but it seems overly complex and unnecessary. There must be a simpler way, one would think.
Thank you.