What's a good workaround to this IE bug that would still allow me to set the display style of an HTML element to 'inherit' in IE7 or IE6 using javascript?
var el = document.getElementById('someElementID');
if (!el) return false;
try {
var displayValue = 'inherit';
//the next line throws exception in IE7 and IE6
// when displayValue = 'inherit'
// but not for other legit values like 'none', 'block', 'inline' or even ''
el.style['display'] = displayValue;
} catch (e) {
alert(e.message);
}
Assume that I don't want to set visible: hidden
, position:absolute
it out of view or z-index
it under something else.