This code is working on [JSFiddle](https://jsfiddle.net/emresaracoglu/dxqzmfb4/#&togetherjs=L0duySkptv) but It does not work on my script also, I get this error with [Firebug](http://getfirebug.com/)

Where is my mistake?

> 
> TypeError: `document.getElementById(...) is null`
> 
> 
> 

```
document.getElementById("image").onclick = function() {
  if (this.src == "https://i.stack.imgur.com/5FoXm.png?s=48&g=1") {
    this.src = "https://i.stack.imgur.com/EoD62.jpg?s=32&g=1";
  } else {
    this.src = "https://i.stack.imgur.com/5FoXm.png?s=48&g=1";
  }
};

```