this is the function

<SCRIPT TYPE="Text/JavaScript">
<!-- Beginning of JavaScript -

function changecolor(code) {

// - End of JavaScript - -->

this is the code

<a href="" onmouseover="document.bgColor='turquoise'">C</a>
<a href="" onmouseover="document.bgColor='pink'">h</a>
<a href="" onmouseover="document.bgColor='blue'">o</a>
<a href="" onmouseover="document.bgColor='red'">o</a>
<a href="" onmouseover="document.bgColor='yellow'">s</a>
<a href="" onmouseover="document.bgColor='green'">e</a>
<a href="" onmouseover="document.bgColor='white'">your</a> 
<a href="" onmouseover="document.bgColor='greem'">o</a>
<a href="" onmouseover="document.bgColor='seagreen'">w</a>
<a href="" onmouseover="document.bgColor='magenta'">n</a>
<a href="" onmouseover="document.bgColor='fusia'">b</a>
<a href="" onmouseover="document.bgColor='purple'">a</a>
<a href="" onmouseover="document.bgColor='navy'">c</a>
<a href="" onmouseover="document.bgColor='royalblue'">k</a>
<a href="" onmouseover="document.bgColor='Skyblue'">g</a>
<a href="" onmouseover="document.bgColor='brown'">r</a>
<a href="" onmouseover="document.bgColor='almond'">o</a>
<a href="" onmouseover="document.bgColor='coral'">u</a>
<a href="" onmouseover="document.bgColor='olivedrab'">n</a>
<a href="" onmouseover="document.bgColor='teal'">d</a>
<a href="" onmouseover="document.bgColor='black'">color!</a>

i want to change background color of the page. used this codes but it dont work. i dont know where go wrong. pls help.

Since you are declaring a function in your script, you need to call that function and sending the color value.


Then in the function;

Since you are using anchor elements, you may want to remove the page loading function of the link in case the user clicks on it.

<a href="javascript: void(0)">I am not clickable</a>

Thank u JorgeM for the help.. =)