Send to a Friend

mirza's avatar

Why isnt this javascript working?

Asked by mirza (5057points) November 8th, 2007

This code runs perfectly when i test it on dreamweaver or just plain notepad. But when i paste these lines of code onto my tumblr theme, they dont work anymore. Any idea why??

<head>
<script language=“JavaScript”>
var backColor = new Array();
backColor[0] = ’#FF9900’;
backColor[1] = ’#6498cc’;
function changeBG(whichColor){
document.bgColor = backColor[whichColor];
}
</script></head>

<body>

<a href=“javascript:changeBG(0)”>Orange</a>
<a href=“javascript:changeBG(1)”>Blue</a>
</body>

Using Fluther

or

Using Email

Separate multiple emails with commas.
We’ll only use these emails for this message.