function globalModelToggleClicked(modname)
{
var state = this.checked ? true : false;
var display = this.checked ? 'inline-block' : 'none';
var inputs = document.getElementsByTagName('input');
var input_l = inputs.length;
// check uncheck inputs checkboxes
while(input_l--)
{
var input = inputs[input_l];
if(input.getAttribute('class') == modname)
{
input.checked = state;
}
}
// show/ hide all colorings
var main = document.getElementById('main');
var divs = main.getElementsByTagName('div');
var divs_l = divs.length;
var regex = new RegExp(modname);
while(divs_l--)
{
var div = divs[divs_l];
if( regex.test(div.getAttribute('class'))
&& ( /hit/.test(div.getAttribute('class'))
|| /seqBorder/.test(div.getAttribute('class'))
)
)
{
div.style.display = display;
}
}
}
function localModelToggleClicked(modname)
{
var display = this.checked ? 'inline-block' : 'none';
// get parent fieldset
var fieldset = this.parentNode;
while(fieldset.nodeName != 'FIELDSET')
{
fieldset = fieldset.parentNode;
}
// show/ hide all colorings
var divs = fieldset.getElementsByTagName('div');
var divs_l = divs.length;
var regex = new RegExp(modname);
while(divs_l--)
{
var div = divs[divs_l];
if( regex.test(div.getAttribute('class'))
&& ( /hit/.test(div.getAttribute('class'))
|| /seqBorder/.test(div.getAttribute('class'))
)
)
{
div.style.display = display;
}
}
}
The two above functions toggle the div’s visibility. They work perfectly in all browsers except IE(8) and I have no idea what is wrong. I have tried the debugger, which shows nothing. The functions are on an external script with other functions, which are working. When I alert inside the function everything seems in order. Can anyone help
?
The Problem was with the
getAttribute('class')apparently IE does not accept this. So i use theclassNameinstead. Which works perfectly in all browsers.