The problem is, that IE (and, apparently, Opera) auto-map object ids into global variables. This was first done by IE in ver 4 (I think) to make it's browser more appealing to developers, since this was "easier". In actuality, it's just pollution of the global namespace.
So, what you need to do for Moz is use a proper reference method, such as document.getElementById.
Code:
onclick="document.getElementById('mtabb').style.display='none'">
Of course, it would probably be better to abstract this through a function
Code:
function hideElem( elemId )
{
document.getElementById( elemId ).style.display = 'none';
}
function showElem( elemId )
{
document.getElementById( elemId ).style.display = 'block';
}
...
<a href="#" onclick="hideElem( 'mtabb' );">TESTING</a>
<a href="#" onclick="showElem( 'mtabb' );">PUT IT BACK!!! NOW!!!</a>
That way, you can re-use it for any element on the page.
If you wish to support version 4 browsers, you can abstract this further
Code:
function hideElem( elemId )
{
getElement( elemId ).style.display = 'none';
}
function showElem( elemId )
{
getElement( elemId ).style.display = 'block';
}
function getElement( elemId )
{
return ( typeof document.layers != "undefined" ) ?
document.layers[elemId] :
( document.getElementById || document.all )( elemId );
}
Bookmarks