I want a background image to change with the onclick attribute on html link tag. But its not working.
<ul>
<li><a href="index.php?page=Home" onclick="one();">Home</a> </li>
<li><a href="index.php?page=Achivement" onclick="two();">Achivement</a></li>
<li><a href="index.php?page=Career" onclick="three();">Career</a></li>
<li><a href="index.php?page=Message" onclick="four();">Message</a></li>
<li><a href="index.php?page=opportunity">opportunity</a></li>
<li><a href="upload1.php">Register</a>
<li></li>
</ul>
<script type="text/javascript">
function one(){
$('body').css('background-image','url(image/back1.jpg)');
}
function two(){
$('body').css('background-image','url(image/back2.jpg)');
}
function three(){
}
function four(){
} </script>
as you can see I tried passing a function on the onclick attribute and I have already defined these function on the bottom already and still the background image wont change. I have checked the directory where the images are they are correct. and I havent defined any background image on my css so. I need help and its driving me crazy.