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

前端 未结 7 1319
独厮守ぢ
独厮守ぢ 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:19

    What you could do is insert a inline script tag at the end of the document, or immediately after the div with id "extraControls". Should be fire a little sooner than.

    i want to be invisible!

    Of course you could do this server-side as well, but maybe there's a good reason you don't want to do that (like, have the controls visible if the browser does NOT support javascript).

提交回复
热议问题