<script language="javascript">
//run Script and watch what happened
var j=2;
for(i=1;i<=10;i++)
{
tab=i*j;
document.write(i+"*"+j+"="+tab+"<br/>");
}
</script>
Output:
1*2=2
2*2=4
3*2=6
4*2=8
5*2=10
6*2=12
7*2=14
8*2=16
9*2=18
10*2=20
2*2=4
3*2=6
4*2=8
5*2=10
6*2=12
7*2=14
8*2=16
9*2=18
10*2=20
//run Script and watch what happened
<script language="javascript">
for(i=0;i<=255;i=i+15)
{
for(j=0;j<=255;j=j+20)
{
for(k=255;k>=0;k=k-15)
{
//rgb() could be use in html. Rgb() has three argument for generating colors.
document.write("<h2 style='color:rgb("+i+","+j+","+k+")'>hello</h2>"); }
}
}
</script>
No comments:
Post a Comment