How to get selected text from a text area in jquery?
This question already has an answer here:
About to make the selected content as bold, you can't do that directly in the textarea but you can do that using editable divs. This plugin could help you: http://mistic100.github.io/jquery-highlighttextarea/
About your comment: "How can i get the all text from a div excluding html tags?" you can use something like this: jQuery('.yourDiv').text();
链接地址: http://www.djcxy.com/p/41636.html