I am looking to implement a feature where only keyboard navigation triggers row highlighting in a table, rather than mouseover events.
When using the tab
key to move through the rows, I want the highlight effect to be activated.
<table>
<tr><td>Row1</td></tr>
<tr><td>Row1</td></tr>
<tr><td>Row1</td></tr>
</table>
To achieve this, I have defined the following CSS rule for highlighting:
table tr:hover{
background: yellow
}
You can view the code and functionality on JS Fiddle by clicking here.
The goal is to disable row highlighting on mouseover interactions but enable it when using the TAB key for navigation.