V tabuľke zvýrazniť riadok po prejdení myšou
JavaScript -> Ukážkové programy v JavaScripte -> V tabuľke zvýrazniť riadok po prejdení myšou
<script language=JavaScript>
<!--
function select (row){
row.style.background = '#dbdbdb';
}
function deselect (row){
row.style.background = 'none';
}
// -->
</script>
<table border=1>
<tr onmouseover='select(this);' onmouseout='deselect(this);'>
<td>Bunka 1
<td>Bunka 2
<tr onmouseover='select(this);' onmouseout='deselect(this);'>
<td>Bunka 3
<td>Bunka 4
</table>
<!--
function select (row){
row.style.background = '#dbdbdb';
}
function deselect (row){
row.style.background = 'none';
}
// -->
</script>
<table border=1>
<tr onmouseover='select(this);' onmouseout='deselect(this);'>
<td>Bunka 1
<td>Bunka 2
<tr onmouseover='select(this);' onmouseout='deselect(this);'>
<td>Bunka 3
<td>Bunka 4
</table>
Ukážka, ako to bude vyzerať v praxi.