I haven't ever done it but there are plenty of javascript text editing widgets (and they must be able to tell what text is selected, at least within a text or input field) I would have a look at the jQuery WYSIWYG editor's source.
Just my two bits : ) -Jordan On Tue, Sep 21, 2010 at 9:17 PM, Jonathan Duncan <[email protected]> wrote: > > On 21 Sep 2010, at 19:40, Wade Preston Shearer wrote: > >> Using javascript, it is possible to get the HTML element(s) that selected >> text are contained within? And by selected text, I mean text that you >> selected with the mouse (cursor). >> > > That might be tricky. From what I understand the text highlighting is a > system level activity. I think the only way to do this would be to watch the > document for a onmousedown, then check cursor position, then onmouseup, and > check cursor position again. Just my quick thoughts. Have not googled it. > > > _______________________________________________ > > UPHPU mailing list > [email protected] > http://uphpu.org/mailman/listinfo/uphpu > IRC: #uphpu on irc.freenode.net > _______________________________________________ UPHPU mailing list [email protected] http://uphpu.org/mailman/listinfo/uphpu IRC: #uphpu on irc.freenode.net
