I have recently learned that HTML elements now have a hidden attribute that you can set on them directly.

If you are not using the hidden CSS class for anything else, feel free to just use container.hidden here and below instead of altering the css class.  If there are CSS transitions or anything, however, then using hidden as a class makes more sense.