For future reference, rather changing the value of display directly like that, it's easier to just add/remove a class which will apply display: none;
Doing it that way, you don't have to worry about whether it should be 'block', 'inline', 'table-cell', 'grid', etc. You just apply display: none; with a class to hide it, then remove the class so display: none; gets removed and it falls back to whatever the previous value was.