Fetching cursor location and highlighted text in textarea using JQuery
问题 Having a textarea in a form I am trying to do several things: fetch the current location of the cursor within the text area fetch the current selection within the textarea insert some text at the current cursor location replace the current selection by some other text As I am already using JQuery, I'd prefer a solution that works smoothly with that. Any pointers how to achieve the above would be appreciated. 回答1: There are many jQuery plugins for this. Here's a good one I've used before: http