function randColor()
dim re,i,ranNum
for i=1 to 3
randomize
ranNum=hex(int(255*rnd)+1)
if(len(ranNum)=1) then ranNum="0" & ranNum
re=re & ranNum
next
randColor = "#" & re
end function
sub test
'设置最多产生1000个色块。
if counter>1000 then exit sub
dim strHTML ,color
color=randColor()
strHTML="<span style='background-color:" & color & ";' onclick='vbs:getColor me' title='" & color & "'></span>"
document.body.insertAdjacentHTML "beforeEnd",strHTML
counter =counter +1
end sub
sub getColor(obj)
ipt.value=obj.title
ipt.select
choice.style.backgroundColor=obj.title
window.clipboardData.setData "Text",ipt.value
end sub
sub gogogo
aaa=window.setInterval("test","10","VBScript")
end sub
sub shutUp
window.clearInterval aaa
end sub
</SCRIPT>
</head>