I am trying to change the image in JavaScript + Prototype by changing the src attribute of this element. It works fine in IE, but not in Firefox. I get no errors and the script continues to execute after this bit is executed:
var image = $('toggle'); image.setAttribute("src", "../images/icons/icon_minus.gif"); image.setAttribute("alt", "Minus Symbol"); image.setAttribute("title", "Collapse tree");
What am I doing wrong? How to make the browser replace the existing image "icon_plus.gif" with "icon_minus.gif"? I am sure that this should be something really obvious, but I can’t understand that!
thanks
source share