explanation
I have a script that hides elements, if the user does not have the permission to view/use it. I set display: none
for those elements.
Now later, when I want to show the elements again, I don't just want to set display: block
or something, because maybe the elements original display
value was something other than block
. Is there a way I can revert the display or set it to a neutral value?
example
E.g. <div class="fancy-class">...</div>
If fancy-class
has display
set to inline-block
and I just set it to block
with my script, that will break the ui.
attempts
I have tried using display: initial
but that resets it to the HTML-element's initial styling - not the class's styling.
I hope I don't have to keep the original values in an array and then apply them again. Doesn't seem nice.