Friday 25 August 06
Found a way to replace the alt text – it involves creating a new element, assigning the required attributes and finally then overwriting the original img tag, here is some sample code:
var oldImg = myNode.firstChild;
var newImg = document.createElement(‘img’);
newImg.src = "/new/path/to/image/jpg";
newImg.alt = "my new alt text";
myNode.replaceChild(newImg,oldImg);
Note that this is very basic example and probably only works when ‘myNode’ has a single child node which is of type ‘img’.










