0

How can I change the current text style at the current position of the cursor without chnaging the whole div id's font style?

document.getElementById('message').style.fontWeight='bold';

This changes all the previous text styling in the textarea i have been trying to find a way aboutit but can't seem to find one??

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by shadiadiph
0

You need to look into range selection; however, IE & FF & Chrome are not the same. For FF & Chrome, search the Internet for window.getSelection(). For IE, search for document.selection.createRange().

0

thanks i will do tomorrow going to get some zzzz its 3am here now I will let you know how i get on with it

0

I haven't solved this thread I have been messing around all day with this it would seen a textarea doesn't allow formatting of fonts unless one color or one style is selected unless you display the <html></html> tags so I am going to close this thread.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.