I am using DOM model.
I need to swap all images on a page which has a div expanggif.
I have many more images but i want to change only those one with a new image say openthis.gif.
Please help me this is urgent!
Thanks in advance.
I used this code when I used name of image but has errors...
if(document.images){
var len=document.getElementsByTagName('img').length;
//if you know the number of images then you can directly put the number in place of len
for(x=1;x<len;x++){
var str="fold"+x;
var objStr,obj;;
objStr = 'document.' + str;
obj = eval(objStr);
document.images[obj].src="openfolder.jpg";
}
If someone has a working code please give me that.
I need to swap all images on a page which has a div expanggif.
I have many more images but i want to change only those one with a new image say openthis.gif.
Please help me this is urgent!
Thanks in advance.
I used this code when I used name of image but has errors...
if(document.images){
var len=document.getElementsByTagName('img').length;
//if you know the number of images then you can directly put the number in place of len
for(x=1;x<len;x++){
var str="fold"+x;
var objStr,obj;;
objStr = 'document.' + str;
obj = eval(objStr);
document.images[obj].src="openfolder.jpg";
}
If someone has a working code please give me that.