Link to home
Start Free TrialLog in
Avatar of php-webdesign
php-webdesign

asked on

IE: set style.display with javascript

Hey,

i got the following javascript for hiding and displaying a table-row:

function openItem (itemid){
      document.getElementById('plus' + itemid).style.display = 'none';
      document.getElementById('min' + itemid).style.display = 'inline';
      document.getElementById('item' + itemid).style.display = 'table-row';
}
function closeItem (itemid){
      document.getElementById('plus' + itemid).style.display = 'inline';
      document.getElementById('min' + itemid).style.display = 'none';
      document.getElementById('item' + itemid).style.display = 'none';
}

Works like a charm in FF, but failes in IE... can anybody help me with this?...

Mike
Avatar of Lakio
Lakio
Flag of Iceland image

document.getElementById('item' + itemid).style.display = 'table-row';

table-row - the equivalent of the default styling of the HTML tr element. Not supported by IE.
http://htmldog.com/reference/cssproperties/display/

ASKER CERTIFIED SOLUTION
Avatar of Niversoft
Niversoft
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of php-webdesign
php-webdesign

ASKER

Thanks mate, works like a charm :D