JavaScript - Hide a Div at startup (load)

前端 未结 6 1757
南方客
南方客 2020-12-29 03:17

I have a div in my php page that uses jQuery to hide it once the page has loaded. But is there a way to hide it from the very start of loadup?

The reason I ask is be

6条回答
  •  感动是毒
    2020-12-29 03:53

    Using CSS you can just set display:none for the element in a CSS file or in a style attribute

    #div { display:none; }
    

    or having the js just after the div might be fast enough too, but not as clean

提交回复
热议问题