Hi,
I'm working on a simple WYSIWYG editor. So far everything goes well, except for one thing:
Most (or, every, probably) WYSIWYG editor I know that has the B, I and U buttons, applies a 'click' effect when the text you are typing is bold, italic or underlined.
So when you're typing something, and make a part of the text bold, the B button becomes 'active', the image changes. When you select a text that is NOT bold, it turns back to it's normal state.
I'm using an iframe and use Javascript to set the designmode to "on". The buttons work with the execCommand() function. How can I 'detect' the style of a piece of text (where the cursor is currently at) in order to change the look of the buttons accordingly?
Thanks in advance