I just started reading about JavaScript. As a language, I don't have any trouble with it, but I came across an annoying situation.
I was going to try my first JavaScript function for a simple action: changing the src attribute of an <img>.
So let's imagine I have this code in index.html:
function activate(id) {
document.images(id).src = "home-on.jpg";
}
function deactivate(id) {
document.images(id).src = "home-off.jpg";
}
<img id="home" src="home-off.jpg" onmouseover="activate('home')" onmouseout="deactivate('home')"/>
The code works perfectly on Google Chrome (swapping the image when the mouse is over, and out), but I have no luck with Firefox.
Any help?