<HTML>
<HEAD>
<TITLE>bgColor属性</TITLE>
<Script Language="JavaScript">
a=new Array();
for(i=0;i<6;i++)
a[i]=parseInt(Math.random()*16+1);
ColorStr="#"+fun(a[0])+fun(a[1])+fun(a[2])+fun(a[3])+fun(a[4])+fun(a[5]);
document.write("<BODY bgcolor="+ColorStr+">")
function fun(num)
{
if(a>=10)
return a-10+'A';
else
return num;
}
</Script>
</HEAD>
</BODY>
</HTML>
评论