Javascipt select a sentence in textarea
- by John Adawan
I'm thinking if there is a way to use javascript to pick up ANY ONE sentence from a textarea simply by clicking any position within that sentence.
I'm thinking along the line of
- first, get current cursor position (which I know how)
- second, somehow locate the position of the previous fullstop and the next fullstop (how?)
- take whatever content within the two fullstops. (how?)
Or there is a simple way to do it?