Examples of hiding and displaying jQuery Elements
This article mainly introduces how to hide and display jQuery elements. Examples of how to use hide and show are analyzed. For more information, see
This document describes how to hide and display jQuery elements. Share it with you for your reference. The specific implementation method is as follows:
The Code is as follows:
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head runat = "server">
<Title> </title>
<Script type = "text/jscript" src = "jquery/jquery-1.10.2.js"> </script>
<Script type = "text/javascript">
$ (Document). ready (function (){
$ ("# But1"). click (function (){
$ ("# Tex1"). hide ();
});
})
$ (Document). ready (function (){
$ ("# But2"). click (function (){
$ ("# Tex1"). show ();
});
})
</Script>
</Head>
<Body>
<Form id = "form1" runat = "server">
<Div>
<Input type = "button" value = "client hide" onclick = "document. getElementById ('text1'). style. display = 'none'"/>
<Input type = "button" value = "client display" onclick = "document. getElementById ('text1'). style. display = 'inline'"/>
<Input type = "button" value = "$ hide client" id = "but1"/>
<Input type = "button" value = "$ client display" id = "but2"/>
<Input type = "text" id = "tex1"/>
</Div>
</Form>
</Body>
</Html>
I hope this article will help you with jQuery programming.