How to get selected text from a text area in jquery?

This question already has an answer here:

  • How to get selected text from textbox control with javascript 5 answers

  • 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

    上一篇: 如何删除ContentEditable中的H1格式(wysiwyg)

    下一篇: 如何从jquery中的文本区域获取选定的文本?