How do I hide an HTML element before the page loads using jQuery

前端 未结 7 1333
独厮守ぢ
独厮守ぢ 2020-12-07 20:44

I have some JQuery code that shows or hides a div.

$(\"div#extraControls\").show();   // OR .hide()

I initially want the div to be not visi

7条回答
  •  情话喂你
    2020-12-07 21:14

    Make a css class

    .hidden {
    display: none;
    }
    

    Add this to any element you don't want to be visible when loading the page. Then use $("div#extraControls").show(); to display it again.

提交回复
热议问题