The JQuery selector binds events and modifies content.
This document describes how to bind events to JQuery selector and modify content. Share it with you for your reference. The specific implementation method is as follows:
Copy codeThe Code is as follows:
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Title> Hello World jQuery! </Title>
<Script type = "text/javascript" src = "jquery-1.3.2.min.js"> </script>
</Head>
<Body>
<Div id = "divMsg"> Hello World! </Div>
<Input id = "btnShow" type = "button" value = "display"/>
<Input id = "btnHide" type = "button" value = "hide"/> <br/>
<Input id = "btnChange" type = "button" value = "modify the content to Hello World, jb51! "/>
<Script type = "text/javascript">
$ ("# BtnShow"). bind ("click", function (event) {$ ("# divMsg"). show ();});
$ ("# BtnHide"). bind ("click", function (event) {$ ("# divMsg"). hide ();});
$ ("# BtnChange"). bind ("click", function (event) {$ ("# divMsg" ).html ("Hello World, jb51! ");});
</Script>
</Body>
</Html>
I hope this article will help you with jQuery programming.