TD is Dynamic

[Total: 0    Average: 0/5]

This alters the content of a table TD dynamically.

Body Code:

<style>
.t1{wrap:physical;color:blue}
</style>
<table border=1 width=10>
<tr><td class=t1 id=one>blank</td></tr>
</table>
<script>
var items = new Array();
    items[0]="test one"
    items[1]="second test"
    items[2]="third test"
    items[3]="four is the perfect number"
    items[4]="five"
var i=0;
function doIt()
{
  document.getElementById("one").innerHTML=items[i];
  i=(i+1)%items.length;
}
</script>
<hr>
<a href="javascript:doIt()">click me to change table contents</a>

Times Viewed: 0

Leave a Reply

Your email address will not be published. Required fields are marked *