i’m trying to randomly generate a new text color each time the page is reloaded.
<script language=”JavaScript” type=”text/javascript”>
colors = new Array (“#000000″,”#ffcc99″,”#cc0099”)
colorCt = colors.length
function chooseColor() {
if (document.getElementById) {
randomNum = Math.floor ((Math.random() * colorCt))
document.getElementById(newColor).style = colors[randomNum]
}
}
</script>
<body bgcolor=”#FFFFFF” onload=”chooseColor()”>
<font-color: newColor>test</font>
did i mention I don’t really know what I’m doing? I can get this script to work with images when I replace document.getElementById with document.images (and document.picture.src)