Getting the index position of a textarea selection.
I'm really struggling to find any sample code for getting the start and end position of a text area selection (i.e. a textarea contains the phrase "Why isn't there a standard, well-known function that does this?" and somebody selects the word "there" -- using a function, I'd like to be able to grab the start position and end position of the word "there").
Can anybody help me with this, or am I going to have to hack together some long-winded function to do this seemingly simple task?