P
Prasad
Hi all, I am trying to develop a simple rich text editor
I do only require bold, itlaic, underline..
The code for IE is
<script>
function displayEditor(editor, html, width, height)
{
document.writeln('<iframe id="' + editor + '" name="' + editor +
'" width="' + width + 'px" height="' + height + 'px"></iframe>');
var mainContent= '<html id="' + editor + '"><head></head><body
onkeypress=alert("Hi")>"' + html + '"</body></html>' ;
var edit = document.getElementById(editor).contentWindow.document;
edit.write(mainContent);
edit.designMode = "On" ;
}
displayEditor("editor", "html", 250, 200) ;
</script>
"You can use Ctrl+B to bold, Ctrl+U to underline, Ctrl+I for Italic "
Its working fine but I wanted to know which key is pressed .
For this, I have written onkeypress event in the body tag .
But that event is not geing fired .
So what should I do here to know which key is pressed ?
Please help me out ..
Thanx in advance,
I do only require bold, itlaic, underline..
The code for IE is
<script>
function displayEditor(editor, html, width, height)
{
document.writeln('<iframe id="' + editor + '" name="' + editor +
'" width="' + width + 'px" height="' + height + 'px"></iframe>');
var mainContent= '<html id="' + editor + '"><head></head><body
onkeypress=alert("Hi")>"' + html + '"</body></html>' ;
var edit = document.getElementById(editor).contentWindow.document;
edit.write(mainContent);
edit.designMode = "On" ;
}
displayEditor("editor", "html", 250, 200) ;
</script>
"You can use Ctrl+B to bold, Ctrl+U to underline, Ctrl+I for Italic "
Its working fine but I wanted to know which key is pressed .
For this, I have written onkeypress event in the body tag .
But that event is not geing fired .
So what should I do here to know which key is pressed ?
Please help me out ..
Thanx in advance,