Click to See Complete Forum and Search --> : document.getelementbyid


theuedimaster
05-22-2004, 11:04 PM
i have this respecting javasccript:

function ChangeImg(imgid, newimg)
{
document.GetElementById('imgid').src='newimg';
}


<img src="../Images/Otherpics/blackbox.JPG" id="xdblack" onclick="ChangeImg('xdblack', 'Images/Cases/xdreamer2_silver.jpg')" width="26" height="12">

I get an error saying "Object does not support this property or method"

Please Help!

Jona
05-22-2004, 11:32 PM
function ChangeImg(imgid, newimg)
{
document.getElementById(imgid).src=newimg;
}