is there a way to get the highlighted selectionstart and selectedlenght on a span ?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I use my own optimization of the algorithms in IERange, which provides a wrapper around IE’s TextRange (which is what you get from the selection in IE) to give them the same interface as DOM Ranges.
To get the selection in the document, use something like the following:
rangenow has propertiesstartContainerandstartOffset, which are respectively a reference to a node and an offset within that node that represent the start of the selection, and corresponding propertiesendContainerandendOffsetthat represent the end of the selection.