CSS/JS: How to get back the default?

It’s the small things, but I think it is worth writing about it, because I learned something new and maybe you do to!

I help a friend building her homepage and while implementing a small little translation script (I should blog about as well 🤔) the question came up to how to remove the display: none;

At first it was easy, because all my blogs were <div> but now I think I should hide the list element of the language switch as well. So how to set display: $default;?

removeProperty()

element.style.removeProperty('display');

Thanks Aslam!

Update: Thanks to Nils Fahle, I know now another way, one can set the property to initial!

Leave a Reply

Discover more from Winkelwagen

Subscribe now to keep reading and get access to the full archive.

Continue reading