Is there a way in jQuery where I can hide an element, but not change the DOM when it’s hidden? I’m hiding a certain element but when it’s hidden, the elements below it move up. I don’t want that to happen. I want the space to stay the same, but the element to be shown/hidden at will.
Can I do this?
Instead of
hide(), use:hide()sets thedisplaystyle tonone, which completely removes the element from the document flow and causes it to not take up space.visibility:hiddenkeeps the space as it is.