I want to capture keystrokes on table cells. I have the following code that works on IE but not on Firefox / Chrome.
<table id="testing" onkeydown="alert('testing')"><br /> <tr><td>testing</td></tr>` <br /> </table> <br />
Any suggestion?
http://www.w3schools.com/jsref/jsref_onkeydown.asp indicates that most tags support onkeydown.
You need to set the property tabindex(for example tabindex="1") to some value so that it can identify that this table is selected by the keyboard. This allows you to trigger a keyboard event. The following will work in firefox:
tabindex
tabindex="1"
<table id="testing" onkeydown="alert('testing')" tabindex="0"><br /> <tr><td>testing</td></tr><br /> </table>
, -, Firefox Chrome , . .
W3C , onkeydown, Firefox/Chrome, Firefox -. , ( , , )
, ?