RetroZilla/layout/html/tests/table/interactive/bug91443.html
2015-10-20 23:03:22 -04:00

65 lines
1.4 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<style>
#table {
border: 8px solid #000;
background-color: #fff;
padding: 50px;
width: 400px;
height: 200px;
}
#cell {
background-color: #fff;
}
</style>
<script>
var ix;
var a= new Array( "#f00", "#0f0", "#00f", "#000", "#ff0", "#f0f", "#0ff", "#fff" );
var len= a.length;
var what= "table";
var elem;
var text;
var id;
function Init( arg ) {
what= arg;
elem= document.getElementById( arg );
text= document.getElementById( "text" );
text.value= elem.style.backgroundColor;
ix= 0;
}
function Change() {
elem.style.backgroundColor= a[ix++];
if ( ix >= len ) ix= 0;
text.value= elem.style.backgroundColor;
}
</script>
<body onload="Init('table')">
Change the color on the table more than once.
<BR>
<table id=table><tr>
<td id=cell></td>
</tr></table>
<form>
<p>Change
<label><input type=radio name=radio onclick="Init('table')"> Table</label>&nbsp;
<label><input type=radio name=radio onclick="Init('cell')"> Cell</label>&nbsp;
color</p>
<p><input type=button onclick="Change()" value="Change Color">&nbsp;&nbsp;
Table/Cell backgroundColor is <input id=text type=text size=16></p>
<p><input type=button onclick="window.id= setInterval( Change, 1000 )" value="Set Interval">&nbsp;
<input type=button onclick="clearInterval( window.id )" value="Clear Interval"></p>
</form>
</body>