I have a keydown event. I can take out the keyCode from that.
I wish to first prevent the default using event.preventDefault
and then after some conditional check, print back the character corresponding to the keycode to where the cursor actually is.
I guess i can retreive the correct character using
var character = String.fromCharCode(e.charCode);
but how do i print it back to the iframe body also considering the fact that i may required to insert this character to already present text without disturbing the cursor position