M
Manish Tomar
Hi,
Following code seems to be working in IE but not in firefox.
<table border="0" cellpadding="0" cellspacing="0"
onkeypress="alert('key');">
<tr>
<td align="center" valign="middle">M</td>
<td align="center" valign="middle">a</td>
<td align="center" valign="middle">n</td>
</tr>
</table>
"key" alert is not displayed in FF. But gets displayed in IE while
pressing any key after selecting the table. As expected it doesn't
work when I press key on other elements of the document. Any reasons
why this is happening??
Another interesting thing I noted was that printable keys like a-z,
0-9, numpad keys were caught whereas other control keys like Alt,
Ctrl, Function keys (ESC was caught) were not caught. Why so? The
following page http://www.w3.org/2002/09/tests/keys2.html registers
key events on input box which captures all keys. Is it like all form
related elements can capture keys? But html spec allows these events
to be registered on table & other elements.
Thanks in advance,
Manish
Following code seems to be working in IE but not in firefox.
<table border="0" cellpadding="0" cellspacing="0"
onkeypress="alert('key');">
<tr>
<td align="center" valign="middle">M</td>
<td align="center" valign="middle">a</td>
<td align="center" valign="middle">n</td>
</tr>
</table>
"key" alert is not displayed in FF. But gets displayed in IE while
pressing any key after selecting the table. As expected it doesn't
work when I press key on other elements of the document. Any reasons
why this is happening??
Another interesting thing I noted was that printable keys like a-z,
0-9, numpad keys were caught whereas other control keys like Alt,
Ctrl, Function keys (ESC was caught) were not caught. Why so? The
following page http://www.w3.org/2002/09/tests/keys2.html registers
key events on input box which captures all keys. Is it like all form
related elements can capture keys? But html spec allows these events
to be registered on table & other elements.
Thanks in advance,
Manish