How to show / hide multiple elements at the same time with javascript

前端 未结 5 439
名媛妹妹
名媛妹妹 2021-01-22 01:11

So, I have this between my head tags



        
5条回答
  •  面向向阳花
    2021-01-22 01:54

    Difference between display and visible:

    • An element that is visible still takes up space on the page. The adjacent content is not rearranged when the element is toggled between visible and hidden.
    • An element that is display=none will not take up any space on the page. Other display values will cause the element to take up space. For example, display=block not only displays the element, but adds line breaks before and after it.

提交回复
热议问题