javascript toggle class name

this is my code for toggle class name

Working in Firefox and IE locally, working in Firefox online, NOT WORKING in IE online!!
How can it be? I have even saved page from internet (that is not working) to local pc again and  is working.

If you don't have quick fix please give me some other toggle class script.
<script type="text/javascript"> 
function changeClass(elementID, className1,className2)
    var elem = document.getElementById(elementID);
    elem.className = (elem.className == className1)?className2:className1;


<a id="check" class="none" href="javascript:{}" onclick="showHide('somediv'); changeClass ('check','active','none')" >test</a>

Open in new window

Who is Participating?
hieloConnect With a Mentor Commented:
<a id="check" class="none" href="#" onclick="showHide('somediv'); changeClass ('check','active','none'); return false;" >test</a>
mankisAuthor Commented:
and now is not working locally.

here is my css, just in case, but It displays without any style so it probably doesn't matter
                    width: 43px;
      height: 55px;
      padding: 0 5px 0 0;
      background: url(../images/unchecked.gif) no-repeat top left;
      display: block;
      float: left;
      background: url(../images/checked.gif) no-repeat top left;
mankisAuthor Commented:
it works without return false; at the end. Don't know why
thanks for helping me
All Courses

From novice to tech pro — start learning today.