This is my code and its not working :(
<html>
<head>
<script LANGUAGE="JavaScript">
function main()
{
var favcolor, purple, blue, pink, yellow;
favcolor=prompt("Which colour do you prefer? purple, blue, pink or yellow?");
if(favcolor==purple)
{document.bgColor = '#CC00CC';}
if(favcolor==blue)
{document.bgColor = 'blue';}
if(favcolor==pink)
{document.bgColor = 'pink';}
if(favcolor==yellow)
{document.bgColor = 'yellow';}
document.write("You prefer "+favcolor+"? Cool!");
}
</script>
</head>
<body>
<center>
<script LANGUAGE="JavaScript">main();</script>
</body>
</html>
Tags: