1. bind multiple events to the object through ing.
2. Sample Code:
Copy codeThe Code is as follows: <! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<Title> bind events in the ing mode </title>
<Script type = "text/javascript" src = "jquery-1.8.3.min.js"> </script>
<Script type = "text/javascript">
$ (Function (){
$ (". Txt"). bind ({focus: function (){
$ ("# DivTip" mongo.show(mongo.html ("focus event is executed ");
},
Change: function (){
$ ("# DivTip" ).show().html ("the change event is executed ");
}
})
})
</Script>
</Head>
<Body>
<Div> name: <input type = "text" class = "txt"/> </div>
<Div id = "divTip" class = "clsTip"> </div>
</Body>
</Html>
3. Preview:
Place the cursor in the text box and click it. The result is as follows:
Enter the content in the text box and click the cursor on another blank page. The effect is as follows: