Try this:
HTML (note that you have to set contenteditable on the span, not the parent paragraph, and it cannot be both):
<p>A function is <span class="bold" contenteditable="true" onkeyup="myFunction()" >triggered</span> when the user is pressing a key in the input field.</p>
<p contenteditable="true" onkeyup="myFunction()" >A function is triggered when the user is pressing a key in the input field.</p>
<div id='foo'>Not Yet</div>
CSS:
.bold { font-weight: bold; }
Fiddle: http://jsfiddle.net/wTy3C/2/