IE: Could not get the visibility property. Invalid argument.
Microsoft’s Internet Explorer never fails to amaze me – coding JavaScript and CSS for the IE is quite a challenge. The other day I tried to show/hide a table based on the value of a dropdown box.
1 2 3 4 5 6 7 8 9 | function hideUnhideDateFields() { var tarifScheme = document.getElementById("dropdownTarifscheme"); var dateTable = document.getElementById("dateTable"); if (tarifScheme && tarifScheme.value == "") { dateTable.style.visibility = "collapse"; } else { dateTable.style.visibility = "visible"; } } |
While this works flawlessly with browsers, the script crashes in IE: it complains about “Could not get […]