Im experimenting in a custom WYSIWYG editor using contenteditable. I use the following code to highlight the selected text in bold:
$('.wysiwyg-b').click(function() {
document.execCommand('bold',false,true);
alert('hi');
});
<li class="wysiwyg-b" title="Bold"><img src="images/icons/black/png/font_bold_icon&16.png"> </li>
And it looks like this:

My problem is that the text is only shown in bold when I click on the image (B), and not when I click on the blue neighborhood .... but this is a warning. What could be causing this problem?
Here is the fiddle http://jsfiddle.net/3b4QM/
I changed the image to B because the path was broken.
console.log(this)
returns
<li class="wysiwyg-b" original-title="Bold">
source
share