The CSS rules visibility:hidden and display:none both result in the element not being visible. Are these synonyms?
The difference goes beyond style and is reflected in how the elements behave when manipulated with JavaScript.
Effects and side effects of display: none:
clientWidth, clientHeight, offsetWidth, offsetHeight, scrollWidth, scrollHeight, getBoundingClientRect(), getComputedStyle(), all return 0s.Effects and side-effects of visibility: hidden:
innerText (but not innerHTML) of the target element and descendants returns empty string.