I have a function in JS that hides the element parsed:
function hide(id){
document.getElementById(id).style.display = \"none\";
}
How can
You need just assign it to empty value:
document.getElementById(id).style.display = "";
Or using removeProperty
method:
document.getElementById(id).style.removeProperty( 'display' );
But note that removeProperty
will not work on IE<9
.
If you want to get original CSS value you will need probably to get it from empty element. I created example on jsFiddle how to get current value using
getComputedStyle
and iframe value on jsFiddle.
Please note that getComputedStyle
not support old versions of IE. It support IE9+.
For IE8 you should use Element.currentStyle