jayakodiu@yahoo.com
The following code works fine with IE:
code:
<html>
<head>
<title>Changing Font Color</title> </head>
<body> <h1> <span id="mytext"> The color is black. </span> </hi>
</body>
<script type="text/javascript">
var colors = []; colors[0] = "black"; colors[1] = "blue"; colors[2] = "yellow"; colors[3] = "orange";
colors[4] = "blue"; colors[5] = "green";
for (i=0; i < 4; i++) {
var c = window.prompt ("Enter a number from 0 to 5: ", "");
c = Number(c) || 0; if (c >5) {c=0};
mytext.style.color=colors[c]
mytext.innerText="The color is "+colors[c]
}
</script>
</html>