We have text in the document and part of the text was selected by user with mouse like:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa****aaaa aaaaaaaaaaaaaaaaaaaaa aaaaaaa
a aaaaaaa aaaaaaaaaaaaa aaaa****aaaaaaaa aaaaaaaaaaaaaaaaaaa aaaaaaaaaaa
How can I check if selection is only in one line or in both?
html structure is like:
<div>
<span> aaaaaaaaaa aaaaaaaaaaa aaa <span> selectedt text </span> </span>
</div>
Don’t know exactly what you are going for, but maybe this could help;
http://www.quirksmode.org/js/events_mouse.html
Under section ‘relatedTarget, fromElement, toElement’ –> when you give the span elements an id, you could check from which element you started, and in which you ended. Hereby knowing if there was a cross in elements.
I do not think that it’s possible to know exactly on which line (on screen) the user starts ends, because of text wrapping, resolution, screen size, font size etc.