Jquery and js hide and display div, jqueryjsdiv
JQuery display and hide div:
Display:
$ ("# Id"). show ()
Hide:
$ ("# Id"). hide ()
Js display and hide div:
The visibility of div can control the display and hiding of div, but the page is blank after hiding
Style = "visibility: none ;"
Document. getElementById ("typediv1"). style. visibility = "hidden"; // hide
Document. getElementById ("typediv1"). style. visibility = "visible"; // display
By setting the display attribute, you can hide the div and release the occupied page space, as shown below:
Style = "display: none ;"
Document. getElementById ("typediv1"). style. display = "none"; // hide
Document. getElementById ("typediv1"). style. display = ""; // display
Jquery or js hides the content in a DIV. You can hide the content without displaying the content. No CSS is required. CSS will be used. I only need jquery or js to hide the content.
Jquery Syntax: <script type = "text/javascript">
$ (& Quot; #123 & quot;). hide ();
</Script>
& Lt; div id = "123" & gt; rewerwerwerh4 & lt;/div & gt;
This sentence
Use js or jq to set div display and hide
Very simple ~ Just make a judgment ~ The Code is as follows:
<Script type = "text/javascript" src = "jquery-1.8.3.min.js"> </script> <script type = "text/javascript"> $ (function () {var pm_width = $ (document. body ). width (); var width = $ ("# zheli "). width (); if (pm_width> width) {$ ("# xianshi" ).css ("display", "block ");}}); </script>