Is there a way to style a <tr>
element when an <a>
tag inside of it is focused?
Below is the HTML for the table:
<table>
<tr>
<td>
<a href"#" tabindex="1" accesskey="e">edit</a>
</td>
</tr>
</table>
When using the 'Tab' key, the link becomes selected. You can change the styling of the link using the following code:
a:focus {
background: #CCC;
}
It's not possible to wrap the <tr>
in an <a>
tag due to having multiple links on one table row.
Are there any alternative solutions to achieve this?