Maybe you can update the iframe on keydown. The bad thing about this is you have to write the proper actions for the different keys.
The example is crude jquery code.
-
$('iframe.edit').keydown(function(){
-
var key = e.charCode || e.keyCode || 0;
-
if(key == 13){
-
// enter action
-
}elseif(key == 8){
-
// backspace action
-
}else{
-
$(this).append(String.fromCharCode(key));
-
}
-
});
-
an article on creating a wysiwyg editor you can find at http://www.webreference.com/programming/javascript/gr/column12/
the advantage of this code is you don't have to use a iframe you could use a paragraph, a div, a span, or another element you want to change by attaching a class. But that's how i would do it.