Forum:Javascript not working

Yea I know, bad title. I want to get a simple test piece of js working, which toggles visibility of an element. I have this piece of code in MediaWiki:Common.js and MediaWiki:Wikia.js function toggle_visibility(id) { var e = document.getElementById(id); if(e.style.display == 'block') e.style.display = 'none'; else e.style.display = 'block'; }

And the actual page is here, as follows: sdafsd

safljsadlfjlkdsajfjdlsajflkjsalkdjf

Clicking on the first div should toggle visibility of second, but it doesn't do for me. I have tried refreshing cache and waiting half an hour, but it's not working. What am I doing wrong here? Any help appreciated. voice (talk) 16:22, November 5, 2012 (UTC)