I’m trying to change the background image of a table following selection of one of a series of images displayed on a web page each having a radio select button.
This is the javascript routine:
[CODE]<script type=”text/javascript”>
function changeBGImage(whichImage)
{
newImage = “url(images/cards/bgs/” + whichImage;
document.getElementById(‘cardbg’).style.backgroundImage = newImage;
}
</script>
And this is the html where the table is declared:
[CODE]<table id=”cardbg” style=”background-image:url(images/cards/bgs/<?echo $texture;?>)”>
I’ve checked that the name of the background image is being correctly passed to the javascript routine but the table background doesn’t change. Can anyone tell me what I’m doing wrong ?