Skip to content Skip to sidebar Skip to footer

Is There A Cross-browser Solution For Getselection()?

I need to make a comment mechanism in which user highlights a piece of text, clicks 'comment this', and then does something. The Javascript code has to know not only the selected t

Solution 1:

You could try IERange, which creates a selection-like object in IE and adds a getSelection() method to window. I don't think it's perfect but it's about the best standalone Range/selection library there is that I've seen.

Update

I've been working on a Range/selection library called Rangy that goes beyond what IERange provides. There's an early release available at http://code.google.com/p/rangy.

Post a Comment for "Is There A Cross-browser Solution For Getselection()?"