hi
i d like to create a table of safe color for web as online.
i show a table of safe color on the page and i want to by clicking user on the links
background-color document is changed but sorry my script doesnt work
and by running that in Mozila firefox in menu tools->javascirpt consol
in line that function bg valu send show error
my script is as follow:
thanks for your help
i d like to create a table of safe color for web as online.
i show a table of safe color on the page and i want to by clicking user on the links
background-color document is changed but sorry my script doesnt work
and by running that in Mozila firefox in menu tools->javascirpt consol
in line that function bg valu send show error
my script is as follow:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body onLoad="document.bgColor='#ff0000'">
<script type="text/javascript">
<!--
function bg(c)
{
document.bgColor="'#"+c+"'";
}
var t="";
ar_color=new Array('00','33','66','99','CC','FF');
t+='<table>'
for(i=0;i<6;++i)
{
for(j=0;j<6;++j)
{
t+='<tr>';
for(k=0;k<6;++k)
{
color=ar_color[i]+ar_color[j]+ar_color[k];
t+='<td bgColor="#'+color+'"><a href="#" onMouseOver="bg('+color+')" > #'+color+'</a></td>';
}
t+='</tr>';
}
}
t+='</table>';
document.write(t);
document.close();
//-->
</script>
</body>
</html>
Comment