In a form's textarea, I'd like to allow users to select part of their text and by pressing a button, encompass the text with <strong>
tags.
How to do this using jQuery?
In a form's textarea, I'd like to allow users to select part of their text and by pressing a button, encompass the text with <strong>
tags.
How to do this using jQuery?
you can try using selectionStart
and selectionEnd
properties to find the selected text. here's the jsfiddle http://jsfiddle.net/XCb95/80/