jquery学习系列5(隐式迭代)
1 <html xmlns="http://www.w3.org/1999/xhtml">
2 <head>
3 <title></title>
4
5 <script language="javascript" src="js/jquery-1.5.js"></script>
6
7 <script language="javascript">
8 $(function() {
9 var elements = $("#btn1");//如果你写错了btn1则会提示
10 if (elements.length <= 0) {
11 alert("no this elment");
12 return;
13 }
14 elements.mouseover(function() {
15 alert("移上去了");
16 })
17 })
18 </script>
19
20 </head>
21 <body>
22 <input type="button" id="btn1" value="dddddd" />
23 </body>
24 </html>