0
I have a table that when being clicked a tr, a screen is generated on the page itself according to what was selected, I need a css code (if possible), that when being clicked the tr it is with a background different from the others, when another tr is clicked, the same goes with a different background as the tag :active a. In my table each tr has a different id and name.
Table:
<tr id='ana' name='ana'>
<td>1</td>
<td>Ana</td>
<td>Informática</td>
</tr>
<tr id='bia' name='bia'>
<td>2</td>
<td>Bia</td>
<td>Logística</td>
</tr>
<tr id='carlos' name='carlos'>
<td>3</td>
<td>Carlos</td>
<td>Redes</td>
</tr>
And should this status persist between page sessions or can you just keep it during the session? That is, if the page is updated, what should happen?
– Woss
If the page is updated, all tr should have an equal default background, example all with the white background, was clicked on a tr, that tr should have a blue background, was clicked on another tr, what was previously clicked turns to white and the clicked gets the blue background.
– Carlos Henrique
Preferably in CSS, but would you accept the answer in jquery anyway? I find it difficult to come up with an answer using only CSS
– Bsalvo
Yes, yes @Bsalvo.
– Carlos Henrique
So it seems that the friend Leandro solved his problem.
– Bsalvo