Post your relevant code, describe the issue you are having to help solve your problem.
My thought is display a textarea element, a button, and then a div for the preview.
Call a function when you click on a button, and in the function use the values of the selectionStart and selectionEnd properties of the textarea and assign that to a string. Then take the string and wrap that string with <b> tags for bold, display it in the preview div...
I don't think you can directly show the bold effect in the textarea. As JorgeM mentioned, you should manipulate the content in a seperate div tag or paragraph in order to display the change. So you should have another button called preview textarea.