Koda: |
<table summary="spremeni">
<tr id="v1">
<td >1.1</td><td>1.2</td><td>1.3</td>
</tr>
<tr id="v2">
<td>2.1</td><td>2.2</td><td>2.3</td>
</tr>
<tr id="v3">
<td>3.1</td><td>3.2</td><td>3.3</td>
</tr>
<tr id="v4">
<td>4.1</td><td>4.2</td><td>4.3</td>
</tr>
</table>
<form action="akcija.html">
<input type="button" value="Barve ozadja celic"
onclick="zadi()" />
</form>
<script type="text/javascript">
i=0
barve= new Array ("blue" , "red" , "green" , "violet", "")
function zadi()
{
i++
if (i==5) i=1
x="v" + i
document.getElementById(x).style.background = barve[(i-1)]
}
</script>
|