Possible Duplicate:
Identify whether the selected text in a web page is bold nor not
I've created a contenteditable div, and this was straightforward enough.
I have as well added a control on top of the div to bold and unbold the text.
Now, I would like to style the button based on the bold status of the text under the cursor - ie: if the text under the cursor is bold, I would like the bold icon to have border 'inset'... and if it's not bold, I would like the bold icon to be without a border.
How can I check the style of the element under the cursor?
Link to the code as it is now: http://jsfiddle.net/aCp7M/